Closed optikfluffel closed 8 years ago
Thanks for looking into this, @optikfluffel! This is a really nice PR!
The only thing that it's missing is a test case for urls that contain //
in a place other than after the protocol... like http://example.com/blah//foo/img.png
, which (AFAIK) is a valid url.
The only thing that it's missing is a test case for urls that contain // in a place other than after the protocol... like http://example.com/blah//foo/img.png, which (AFAIK) is a valid url.
This is valid url, but in this case all browsers will normalize it to http://example.com/blah/foo/img.png
, so it's ok.
I don't think that browsers normalize that... it seems to be a different url entirely. As a quick test, https://github.com/rubik///radon
will 404, but https://github.com/rubik/radon
points to a valid repo
Hm, maybe because this is not a physical url (router error). I'm trying with an image from wikimedia:
http://upload.wikimedia.org/wikipedia/commons/5//5b//Ultraviolet_image_of_the_Cygnus_Loop_Nebula_crop.jpg
and all works fine.
I basically just copied https://github.com/LearnBoost/stylus/issues/1416#issuecomment-36908239 from @Panya to close #189 and added a basic test.