remy / inliner

Node utility to inline images, CSS and JavaScript for a web page - useful for mobile sites
MIT License
1.1k stars 165 forks source link

fix: non-ascii characters #103

Closed mifi closed 8 years ago

mifi commented 8 years ago

When doing a request with the node request module with an URL containing UTF-8 chars, some webservers will fail to find the file. Therefore encodeURI on the url before requesting it. Not sure if this is the best way to test it, but it works with all test cases.

Example of page which doesn't inline properly: http://hotpoticeland.com/holsgerdislaug/ which links to the image: http://hotpoticeland.com/wp-content/uploads/Hólsgerðislaug-300x225.jpg

remy commented 8 years ago

Looking good. I'll merge up with the other open PR (ideally today). Thanks so much.

remy commented 8 years ago

Not sure why this didn't auto close, but it's live in 1.9.3: https://github.com/remy/inliner/commit/a2869fc81a2730252c763244567671871dbb5244