Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

img "srcset" attribute urls are not proxyfied #77

Open
mattvick opened this issue Apr 20, 2016 · 4 comments
Open

img "srcset" attribute urls are not proxyfied #77

mattvick opened this issue Apr 20, 2016 · 4 comments

Comments

@mattvick
Copy link

Loading the following page: http://kalkulackaenergie.com/

Through the proxy: https://www.optimcore.com/proxy/http://kalkulackaenergie.com/

Causes Mixed Content errors because image source urls within an img tag srcset attribute are loaded directly, over http. These urls should be proxyfied.

@nfriedly
Copy link
Owner

Oh, wow, I didn't realize srcset worked now - cool!

Do you think you can write a test and a fix and send me a PR?

For the test, add a line to test/source/index.html and test/expected/index.html and then the existing test infrastructure will find it; and then the fix can probably just be a tweak to the regex at lib/url-prefixer.js#L22

@emilhem
Copy link
Contributor

emilhem commented Aug 1, 2016

It's easy to write a test but fixing srcset seems harder.
Since srcset can contain many urls its tricky to fix.
References:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Img#Example_4_Using_the_srcset_and_sizes_attributes
https://webkit.org/demos/srcset/

@nfriedly
Copy link
Owner

nfriedly commented Aug 1, 2016

Oh, yikes. Maybe this isn't such a good first bug...

@nfriedly
Copy link
Owner

This might help: https://www.npmjs.com/package/srcset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants