stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.91k stars 249 forks source link

fix 189 #244

Closed optikfluffel closed 8 years ago

optikfluffel commented 10 years ago

I basically just copied https://github.com/LearnBoost/stylus/issues/1416#issuecomment-36908239 from @Panya to close #189 and added a basic test.

notslang commented 10 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.

Panya commented 10 years ago

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.

notslang commented 10 years ago

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

Panya commented 10 years ago

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.