|
60 | 60 | { |
61 | 61 | "pattern": [{ "pathname": "/foo/bar" }], |
62 | 62 | "inputs": [{ "pathname": "/foo/bar/baz", |
63 | | - "baseURL": "https://example.com" }], |
| 63 | + "baseURL": "https://example.com" }], |
64 | 64 | "expected_match": null |
65 | 65 | }, |
66 | 66 | { |
67 | 67 | "pattern": [{ "pathname": "/foo/bar", |
68 | | - "baseURL": "https://example.com?query#hash" }], |
| 68 | + "baseURL": "https://example.com?query#hash" }], |
69 | 69 | "inputs": [{ "pathname": "/foo/bar" }], |
70 | 70 | "expected_match": null |
71 | 71 | }, |
72 | 72 | { |
73 | 73 | "pattern": [{ "pathname": "/foo/bar", |
74 | | - "baseURL": "https://example.com?query#hash" }], |
| 74 | + "baseURL": "https://example.com?query#hash" }], |
75 | 75 | "inputs": [{ "hostname": "example.com", "pathname": "/foo/bar" }], |
76 | 76 | "expected_match": null |
77 | 77 | }, |
78 | 78 | { |
79 | 79 | "pattern": [{ "pathname": "/foo/bar", |
80 | | - "baseURL": "https://example.com?query#hash" }], |
| 80 | + "baseURL": "https://example.com?query#hash" }], |
81 | 81 | "inputs": [{ "protocol": "https", "hostname": "example.com", |
82 | | - "pathname": "/foo/bar" }], |
| 82 | + "pathname": "/foo/bar" }], |
83 | 83 | "exactly_empty_components": [ "port" ], |
84 | 84 | "expected_match": { |
85 | 85 | "hostname": { "input": "example.com", "groups": {} }, |
|
89 | 89 | }, |
90 | 90 | { |
91 | 91 | "pattern": [{ "pathname": "/foo/bar", |
92 | | - "baseURL": "https://example.com" }], |
| 92 | + "baseURL": "https://example.com" }], |
93 | 93 | "inputs": [{ "protocol": "https", "hostname": "example.com", |
94 | | - "pathname": "/foo/bar" }], |
| 94 | + "pathname": "/foo/bar" }], |
95 | 95 | "exactly_empty_components": [ "port" ], |
96 | 96 | "expected_match": { |
97 | 97 | "hostname": { "input": "example.com", "groups": {} }, |
|
101 | 101 | }, |
102 | 102 | { |
103 | 103 | "pattern": [{ "pathname": "/foo/bar", |
104 | | - "baseURL": "https://example.com" }], |
| 104 | + "baseURL": "https://example.com" }], |
105 | 105 | "inputs": [{ "protocol": "https", "hostname": "example.com", |
106 | | - "pathname": "/foo/bar/baz" }], |
| 106 | + "pathname": "/foo/bar/baz" }], |
107 | 107 | "expected_match": null |
108 | 108 | }, |
109 | 109 | { |
110 | 110 | "pattern": [{ "pathname": "/foo/bar", |
111 | | - "baseURL": "https://example.com?query#hash" }], |
| 111 | + "baseURL": "https://example.com?query#hash" }], |
112 | 112 | "inputs": [{ "protocol": "https", "hostname": "example.com", |
113 | | - "pathname": "/foo/bar", "search": "otherquery", |
114 | | - "hash": "otherhash" }], |
| 113 | + "pathname": "/foo/bar", "search": "otherquery", |
| 114 | + "hash": "otherhash" }], |
115 | 115 | "exactly_empty_components": [ "port" ], |
116 | 116 | "expected_match": { |
117 | 117 | "hash": { "input": "otherhash", "groups": { "0": "otherhash" } }, |
|
123 | 123 | }, |
124 | 124 | { |
125 | 125 | "pattern": [{ "pathname": "/foo/bar", |
126 | | - "baseURL": "https://example.com" }], |
| 126 | + "baseURL": "https://example.com" }], |
127 | 127 | "inputs": [{ "protocol": "https", "hostname": "example.com", |
128 | | - "pathname": "/foo/bar", "search": "otherquery", |
129 | | - "hash": "otherhash" }], |
| 128 | + "pathname": "/foo/bar", "search": "otherquery", |
| 129 | + "hash": "otherhash" }], |
130 | 130 | "exactly_empty_components": [ "port" ], |
131 | 131 | "expected_match": { |
132 | 132 | "hash": { "input": "otherhash", "groups": { "0": "otherhash" } }, |
|
138 | 138 | }, |
139 | 139 | { |
140 | 140 | "pattern": [{ "pathname": "/foo/bar", |
141 | | - "baseURL": "https://example.com?otherquery#otherhash" }], |
| 141 | + "baseURL": "https://example.com?otherquery#otherhash" }], |
142 | 142 | "inputs": [{ "protocol": "https", "hostname": "example.com", |
143 | | - "pathname": "/foo/bar", "search": "otherquery", |
144 | | - "hash": "otherhash" }], |
| 143 | + "pathname": "/foo/bar", "search": "otherquery", |
| 144 | + "hash": "otherhash" }], |
145 | 145 | "exactly_empty_components": [ "port" ], |
146 | 146 | "expected_match": { |
147 | 147 | "hash": { "input": "otherhash", "groups": { "0": "otherhash" } }, |
|
153 | 153 | }, |
154 | 154 | { |
155 | 155 | "pattern": [{ "pathname": "/foo/bar", |
156 | | - "baseURL": "https://example.com?query#hash" }], |
| 156 | + "baseURL": "https://example.com?query#hash" }], |
157 | 157 | "inputs": [ "https://example.com/foo/bar" ], |
158 | 158 | "exactly_empty_components": [ "port" ], |
159 | 159 | "expected_match": { |
|
164 | 164 | }, |
165 | 165 | { |
166 | 166 | "pattern": [{ "pathname": "/foo/bar", |
167 | | - "baseURL": "https://example.com?query#hash" }], |
| 167 | + "baseURL": "https://example.com?query#hash" }], |
168 | 168 | "inputs": [ "https://example.com/foo/bar?otherquery#otherhash" ], |
169 | 169 | "exactly_empty_components": [ "port" ], |
170 | 170 | "expected_match": { |
|
177 | 177 | }, |
178 | 178 | { |
179 | 179 | "pattern": [{ "pathname": "/foo/bar", |
180 | | - "baseURL": "https://example.com?query#hash" }], |
| 180 | + "baseURL": "https://example.com?query#hash" }], |
181 | 181 | "inputs": [ "https://example.com/foo/bar?query#hash" ], |
182 | 182 | "exactly_empty_components": [ "port" ], |
183 | 183 | "expected_match": { |
|
190 | 190 | }, |
191 | 191 | { |
192 | 192 | "pattern": [{ "pathname": "/foo/bar", |
193 | | - "baseURL": "https://example.com?query#hash" }], |
| 193 | + "baseURL": "https://example.com?query#hash" }], |
194 | 194 | "inputs": [ "https://example.com/foo/bar/baz" ], |
195 | 195 | "expected_match": null |
196 | 196 | }, |
197 | 197 | { |
198 | 198 | "pattern": [{ "pathname": "/foo/bar", |
199 | | - "baseURL": "https://example.com?query#hash" }], |
| 199 | + "baseURL": "https://example.com?query#hash" }], |
200 | 200 | "inputs": [ "https://other.com/foo/bar" ], |
201 | 201 | "expected_match": null |
202 | 202 | }, |
203 | 203 | { |
204 | 204 | "pattern": [{ "pathname": "/foo/bar", |
205 | | - "baseURL": "https://example.com?query#hash" }], |
| 205 | + "baseURL": "https://example.com?query#hash" }], |
206 | 206 | "inputs": [ "http://other.com/foo/bar" ], |
207 | 207 | "expected_match": null |
208 | 208 | }, |
209 | 209 | { |
210 | 210 | "pattern": [{ "pathname": "/foo/bar", |
211 | | - "baseURL": "https://example.com?query#hash" }], |
| 211 | + "baseURL": "https://example.com?query#hash" }], |
212 | 212 | "inputs": [{ "pathname": "/foo/bar", "baseURL": "https://example.com" }], |
213 | 213 | "exactly_empty_components": [ "port" ], |
214 | 214 | "expected_match": { |
|
219 | 219 | }, |
220 | 220 | { |
221 | 221 | "pattern": [{ "pathname": "/foo/bar", |
222 | | - "baseURL": "https://example.com?query#hash" }], |
| 222 | + "baseURL": "https://example.com?query#hash" }], |
223 | 223 | "inputs": [{ "pathname": "/foo/bar", |
224 | | - "baseURL": "https://example.com?query#hash" }], |
| 224 | + "baseURL": "https://example.com?query#hash" }], |
225 | 225 | "exactly_empty_components": [ "port" ], |
226 | 226 | "expected_match": { |
227 | 227 | "hostname": { "input": "example.com", "groups": {} }, |
|
231 | 231 | }, |
232 | 232 | { |
233 | 233 | "pattern": [{ "pathname": "/foo/bar", |
234 | | - "baseURL": "https://example.com?query#hash" }], |
| 234 | + "baseURL": "https://example.com?query#hash" }], |
235 | 235 | "inputs": [{ "pathname": "/foo/bar/baz", |
236 | | - "baseURL": "https://example.com" }], |
| 236 | + "baseURL": "https://example.com" }], |
237 | 237 | "expected_match": null |
238 | 238 | }, |
239 | 239 | { |
240 | 240 | "pattern": [{ "pathname": "/foo/bar", |
241 | | - "baseURL": "https://example.com?query#hash" }], |
| 241 | + "baseURL": "https://example.com?query#hash" }], |
242 | 242 | "inputs": [{ "pathname": "/foo/bar", "baseURL": "https://other.com" }], |
243 | 243 | "expected_match": null |
244 | 244 | }, |
245 | 245 | { |
246 | 246 | "pattern": [{ "pathname": "/foo/bar", |
247 | | - "baseURL": "https://example.com?query#hash" }], |
| 247 | + "baseURL": "https://example.com?query#hash" }], |
248 | 248 | "inputs": [{ "pathname": "/foo/bar", "baseURL": "http://example.com" }], |
249 | 249 | "expected_match": null |
250 | 250 | }, |
|
1556 | 1556 | { |
1557 | 1557 | "pattern": [ "https://example.com:8080/foo?bar#baz" ], |
1558 | 1558 | "inputs": [{ "pathname": "/foo", "search": "bar", "hash": "baz", |
1559 | | - "baseURL": "https://example.com:8080" }], |
| 1559 | + "baseURL": "https://example.com:8080" }], |
1560 | 1560 | "expected_obj": { |
1561 | 1561 | "protocol": "https", |
1562 | 1562 | "username": "*", |
|
1579 | 1579 | { |
1580 | 1580 | "pattern": [ "/foo?bar#baz", "https://example.com:8080" ], |
1581 | 1581 | "inputs": [{ "pathname": "/foo", "search": "bar", "hash": "baz", |
1582 | | - "baseURL": "https://example.com:8080" }], |
| 1582 | + "baseURL": "https://example.com:8080" }], |
1583 | 1583 | "expected_obj": { |
1584 | 1584 | "pathname": "/foo", |
1585 | 1585 | "search": "bar", |
|
1615 | 1615 | "protocol": { "input": "https", "groups": {} }, |
1616 | 1616 | "hostname": { "input": "sub.example.com", "groups": { "0": "sub" } }, |
1617 | 1617 | "pathname": { "input": "/foo/bar", "groups": { "product": "foo", |
1618 | | - "endpoint": "bar" } } |
| 1618 | + "endpoint": "bar" } } |
1619 | 1619 | } |
1620 | 1620 | }, |
1621 | 1621 | { |
|
1994 | 1994 | { |
1995 | 1995 | "pattern": [ "https://example.com/foo?bar#baz" ], |
1996 | 1996 | "inputs": [{ "protocol": "https:", |
1997 | | - "search": "?bar", |
1998 | | - "hash": "#baz", |
1999 | | - "baseURL": "http://example.com/foo" }], |
| 1997 | + "search": "?bar", |
| 1998 | + "hash": "#baz", |
| 1999 | + "baseURL": "http://example.com/foo" }], |
2000 | 2000 | "exactly_empty_components": [ "port" ], |
2001 | 2001 | "expected_obj": { |
2002 | 2002 | "protocol": "https", |
|
2009 | 2009 | }, |
2010 | 2010 | { |
2011 | 2011 | "pattern": [{ "protocol": "http{s}?:", |
2012 | | - "search": "?bar", |
2013 | | - "hash": "#baz" }], |
| 2012 | + "search": "?bar", |
| 2013 | + "hash": "#baz" }], |
2014 | 2014 | "inputs": [ "http://example.com/foo?bar#baz" ], |
2015 | 2015 | "expected_obj": { |
2016 | 2016 | "protocol": "http{s}?", |
|
2855 | 2855 | }, |
2856 | 2856 | { |
2857 | 2857 | "pattern": [ "https://example.com:8080/foo?bar#baz", |
2858 | | - { "ignoreCase": true }], |
| 2858 | + { "ignoreCase": true }], |
2859 | 2859 | "inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ", |
2860 | | - "baseURL": "https://example.com:8080" }], |
| 2860 | + "baseURL": "https://example.com:8080" }], |
2861 | 2861 | "expected_obj": { |
2862 | 2862 | "protocol": "https", |
2863 | 2863 | "hostname": "example.com", |
|
2877 | 2877 | }, |
2878 | 2878 | { |
2879 | 2879 | "pattern": [ "/foo?bar#baz", "https://example.com:8080", |
2880 | | - { "ignoreCase": true }], |
| 2880 | + { "ignoreCase": true }], |
2881 | 2881 | "inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ", |
2882 | | - "baseURL": "https://example.com:8080" }], |
| 2882 | + "baseURL": "https://example.com:8080" }], |
2883 | 2883 | "expected_obj": { |
2884 | 2884 | "protocol": "https", |
2885 | 2885 | "hostname": "example.com", |
|
2899 | 2899 | }, |
2900 | 2900 | { |
2901 | 2901 | "pattern": [ "/foo?bar#baz", { "ignoreCase": true }, |
2902 | | - "https://example.com:8080" ], |
| 2902 | + "https://example.com:8080" ], |
2903 | 2903 | "inputs": [{ "pathname": "/FOO", "search": "BAR", "hash": "BAZ", |
2904 | | - "baseURL": "https://example.com:8080" }], |
| 2904 | + "baseURL": "https://example.com:8080" }], |
2905 | 2905 | "expected_obj": "error" |
2906 | 2906 | }, |
2907 | 2907 | { |
|
2961 | 2961 | "pathname": { "input": "/z", "groups": { "0": "z" } } |
2962 | 2962 | } |
2963 | 2963 | }, |
2964 | | - { |
| 2964 | + { |
2965 | 2965 | "pattern": [{ "pathname": "/([\\d&&[0-1]])" }], |
2966 | 2966 | "inputs": [{ "pathname": "/0" }], |
2967 | 2967 | "expected_match": { |
|
2972 | 2972 | "pattern": [{ "pathname": "/([\\d&&[0-1]])" }], |
2973 | 2973 | "inputs": [{ "pathname": "/3" }], |
2974 | 2974 | "expected_match": null |
| 2975 | + }, |
| 2976 | + { |
| 2977 | + "pattern": [{ "protocol": "http", "hostname": "example.com/ignoredpath" }], |
| 2978 | + "inputs": ["http://example.com/"], |
| 2979 | + "expected_obj": { |
| 2980 | + "protocol": "http", |
| 2981 | + "hostname": "example.com", |
| 2982 | + "pathname": "*" |
| 2983 | + }, |
| 2984 | + "expected_match": { |
| 2985 | + "protocol": { "input": "http", "groups": {} }, |
| 2986 | + "hostname": { "input": "example.com", "groups": {} }, |
| 2987 | + "pathname": { "input": "/", "groups": { "0": "/" } } |
| 2988 | + } |
| 2989 | + }, |
| 2990 | + { |
| 2991 | + "pattern": [{ "protocol": "http", "hostname": "example.com\\?ignoredsearch" }], |
| 2992 | + "inputs": ["http://example.com/"], |
| 2993 | + "expected_obj": { |
| 2994 | + "protocol": "http", |
| 2995 | + "hostname": "example.com", |
| 2996 | + "search": "*" |
| 2997 | + }, |
| 2998 | + "expected_match": { |
| 2999 | + "protocol": { "input": "http", "groups": {} }, |
| 3000 | + "hostname": { "input": "example.com", "groups": {} }, |
| 3001 | + "pathname": { "input": "/", "groups": { "0": "/" } } |
| 3002 | + } |
| 3003 | + }, |
| 3004 | + { |
| 3005 | + "pattern": [{ "protocol": "http", "hostname": "example.com#ignoredhash" }], |
| 3006 | + "inputs": ["http://example.com/"], |
| 3007 | + "expected_obj": { |
| 3008 | + "protocol": "http", |
| 3009 | + "hostname": "example.com", |
| 3010 | + "hash": "*" |
| 3011 | + }, |
| 3012 | + "expected_match": { |
| 3013 | + "protocol": { "input": "http", "groups": {} }, |
| 3014 | + "hostname": { "input": "example.com", "groups": {} }, |
| 3015 | + "pathname": { "input": "/", "groups": { "0": "/" } } |
| 3016 | + } |
2975 | 3017 | } |
2976 | 3018 | ] |
0 commit comments