File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ export const compulsoryProtocolValidUrlPattern = new RegExp('^(https?:\\/\\/)' /
20
20
21
21
export const protocolLessValidUrlPattern = new RegExp (
22
22
'^'
23
+ // localhost inclusion
24
+ + '(?:(?:localhost)(:\\d{2,5})?|'
23
25
// user:pass authentication
24
26
+ '(?:\\S+(?::\\S*)?@)?'
25
27
+ '(?:'
26
28
// IP address exclusion
27
29
// private & local networks
28
- + '(?!(?:10|127 )(?:\\.\\d{1,3}){3})'
30
+ + '(?!(?:10)(?:\\.\\d{1,3}){3})'
29
31
+ '(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})'
30
32
+ '(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})'
31
33
// IP address dotted notation octets
@@ -49,7 +51,7 @@ export const protocolLessValidUrlPattern = new RegExp(
49
51
// port number
50
52
+ '(?::\\d{2,5})?'
51
53
// resource path
52
- + '(?:[/?#]\\S*)?'
54
+ + '(?:[/?#]\\S*)?) '
53
55
+ '$' , 'i'
54
56
) ;
55
57
You can’t perform that action at this time.
0 commit comments