1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
[
{
"args": ["/Zürich"],
"exp": "/Z%C3%BCrich",
"name": "U() with utf8 umlaut"
},
{
"args": ["/path#Zürich"],
"exp": "/path#Z%C3%BCrich",
"name": "U() with utf8 umlaut in fragment"
},
{
"args": ["/foo.html?"],
"exp": "/foo.html",
"name": "U() removes ? at end"
},
{
"args": ["/foo.html#"],
"exp": "/foo.html",
"name": "U() removes # at end"
},
{
"args": ["/foo.html?#"],
"exp": "/foo.html",
"name": "U() removes ?# at end"
},
{
"args": ["/foo.html#?"],
"exp": "/foo.html#?",
"name": "U() keeps #? at end"
},
{
"args": ["/foo.html", {"bar": null}],
"exp": "/foo.html",
"name": "U() empty parameter removed"
},
{
"args": ["/foo.html?bar="],
"exp": "/foo.html?bar=",
"name": "U() keep empty parameter with = if only base is given"
},
{
"args": ["/foo.html?foo=bar&qux"],
"exp": "/foo.html?foo=bar&qux",
"name": "U() keep empty parameter without = if only base is given"
},
{
"args": ["/foo.html?bar=", {"foo": "gna"}],
"exp": "/foo.html?foo=gna",
"name": "U() empty parameter with = removed if parameters get changed"
},
{
"args": ["/foo.html?foo=bar&qux", {"gna": "gnaber"}],
"exp": "/foo.html?foo=bar&gna=gnaber",
"name": "U() empty parameter without = removed if parameters get changed"
},
{
"args": ["/foo.html?bar=gna&foo=g", {"bar": ""}],
"exp": "/foo.html?foo=g",
"name": "U() remove parameter in base by overwriting with empty string"
},
{
"args": ["/foo.html?bar=gna&foo=g", {"bar": false}],
"exp": "/foo.html?foo=g",
"name": "U() remove parameter in base by overwriting with false"
},
{
"args": ["/foo.html?bar=gna&foo=g", {"bar": null}],
"exp": "/foo.html?bar=gna&foo=g",
"name": "U() keep parameter in base instead of overwriting with null"
},
{
"args": ["/foo.html", {"bar": {"gna": 42, "qux": {"quux": "<Zürich>", "gnöp": "fasel"}}}],
"exp": "/foo.html?bar%5Bgna%5D=42&bar%5Bqux%5D%5Bquux%5D=%3CZ%C3%BCrich%3E&bar%5Bqux%5D%5Bgn%C3%B6p%5D=fasel",
"name": "U() with nested arrays"
},
{
"args": ["/foo.html?", {"foo" : "bar[qux][gnöp]=fasel"}],
"exp": "/foo.html?foo=bar%5Bqux%5D%5Bgn%C3%B6p%5D%3Dfasel",
"name": "U() with array syntax in value and ? at end of base"
},
{
"args": ["/foo.html?a=b&bar=qux&c=d", {"bar": "baz"}],
"exp": "/foo.html?a=b&bar=baz&c=d",
"name": "U() args override get params in base url"
},
{
"args": ["/foo.html?a=b&bar=qux&c=d", {"bar": "baz", "gna": "gnaber"}],
"exp": "/foo.html?a=b&bar=baz&c=d&gna=gnaber",
"name": "U() args override get params in base url and appends remaining params"
},
{
"args": ["/foo.html?gna=g&a=b&bar=qux&c=d", {"bar": "baz", "gna": "gnaber"}],
"exp": "/foo.html?gna=gnaber&a=b&bar=baz&c=d",
"name": "U() args override get params in base url keeping same order"
},
{
"args": ["/foo.html?bar.qux=a.b", {"c.d": "e.f", "g h": "i j"}],
"exp": "/foo.html?bar.qux=a.b&c.d=e.f&g+h=i+j",
"name": "U() dots and spaces in arg names are preserved"
},
{
"args": ["/foo.html?bar=a+b+c", {"foo": "d e f"}],
"exp": "/foo.html?bar=a+b+c&foo=d+e+f",
"name": "U() handles multiple spaces in parameter values"
},
{
"args": ["/foo.html?bar=qux#frag=frog", {"baz": "gna"}],
"exp": "/foo.html?bar=qux&baz=gna#frag=frog",
"name": "U() fragment after params"
},
{
"args": ["Jet d'eau"],
"exp": "Jet%20d%27eau",
"name": "U() with single quotes in URL"
},
{
"args": ["/test.html?foo=bar?qux=gna", {"?q": "?r"}],
"exp": "/test.html?foo=bar%3Fqux%3Dgna&%3Fq=%3Fr",
"name": "U() quoting of ? in args but not base"
},
{
"args": ["%% %1%x %1x%x1%xx%11%ff%FF%0f%0F %"],
"exp": "%25%25%20%251%25x%20%251x%25x1%25xx%11%ff%FF%0f%0F%20%25",
"name": "U() quoting of % if not followed by 2 hex digits"
},
{
"args": ["path#%% %1%x %1x%x1%xx%11%ff%FF%0f%0F %"],
"exp": "path#%25%25%20%251%25x%20%251x%25x1%25xx%11%ff%FF%0f%0F%20%25",
"name": "U() quoting of % if not followed by 2 hex digits in fragment"
},
{
"args": ["a\\b"],
"exp": "a/b",
"name": "U() converting of \\ to /"
},
{
"args": ["path/#a\\b"],
"exp": "path/#a%5Cb",
"name": "U() encode \\ in fragment"
},
{
"args": ["foo.html?bar=\\gna"],
"exp": "foo.html?bar=%5Cgna",
"name": "U() encode \\ in url parameter"
},
{
"args": ["path/#?a=b"],
"exp": "path/#?a=b",
"name": "U() keep query syntax in fragment"
},
{
"args": ["path/#Jet d'eau"],
"exp": "path/#Jet%20d%27eau",
"name": "U() with single quotes in fragment"
},
{
"args": ["//gna.ch"],
"exp": "//gna.ch/",
"name": "U() add / for absolute url without path"
},
{
"args": ["http://gna.ch"],
"exp": "http://gna.ch/",
"name": "U() add / for absolute http url without path"
},
{
"args": ["app://settings"],
"exp": "app://settings",
"name": "U() do not add / for non-http url without path"
},
{
"args": ["/foo.html", {"<spam>": {"<spam>": "ham"}}],
"exp": "/foo.html?%3Cspam%3E%5B%3Cspam%3E%5D=ham",
"name": "U() urlencode keys of nested structures"
},
{
"args": ["a:javascript:alert('fail');"],
"exp": "alert(%27fail%27)%3B",
"name": "U() remove schema from path"
},
{
"args": ["a:b:c:d:javascript:alert('fail');"],
"exp": "alert(%27fail%27)%3B",
"name": "U() remove multiple schemes from path"
},
{
"args": ["jAvascript:/a/%E2%80%A9alert(JSON.stringify(document.cookie))"],
"exp": "/a/%E2%80%A9alert(JSON.stringify(document.cookie))",
"name": "U() remove multiple schemes from path"
},
{
"args": ["//Oeffnungszeiten:8.30-17.00/"],
"exp": "//Oeffnungszeiten:8.30-17.00/",
"name": "U() with invalid URL"
}
]
|