File tree 1 file changed +31
-0
lines changed 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,37 @@ var urltests = []URLTest{
231
231
},
232
232
"http://user:password@google.com" ,
233
233
},
234
+ // unescaped @ in username should not confuse host
235
+ {
236
+ "http://j@ne:password@google.com" ,
237
+ & URL {
238
+ Scheme : "http" ,
239
+ User : UserPassword ("j@ne" , "password" ),
240
+ Host : "google.com" ,
241
+ },
242
+ "http://j%40ne:password@google.com" ,
243
+ },
244
+ // unescaped @ in password should not confuse host
245
+ {
246
+ "http://jane:p@ssword@google.com" ,
247
+ & URL {
248
+ Scheme : "http" ,
249
+ User : UserPassword ("jane" , "p@ssword" ),
250
+ Host : "google.com" ,
251
+ },
252
+ "http://jane:p%40ssword@google.com" ,
253
+ },
254
+ {
255
+ "http://j@ne:password@google.com/p@th?q=@go" ,
256
+ & URL {
257
+ Scheme : "http" ,
258
+ User : UserPassword ("j@ne" , "password" ),
259
+ Host : "google.com" ,
260
+ Path : "/p@th" ,
261
+ RawQuery : "q=@go" ,
262
+ },
263
+ "http://j%40ne:password@google.com/p@th?q=@go" ,
264
+ },
234
265
{
235
266
"http://www.google.com/?q=go+language#foo" ,
236
267
& URL {
You can’t perform that action at this time.
0 commit comments