premailer / css_parser

Ruby CSS Parser
Other
279 stars 110 forks source link

load_uri! discards query strings #40

Closed duckinator closed 11 years ago

duckinator commented 11 years ago

I ran into this issue with Google Web Fonts. If it should be loading http://fonts.googleapis.com/css?family=Exo|Open+Sans:300italic,400italic,600italic,700italic,300,400,600,700, it instead loads http://fonts.googleapis.com/css. Not quite the same. ;)

The issue is in parser.rb#L442. It Requests uri.path without passing uri.query. I'm not sure how you'd pass that to Net::HTTP.

For anyone else who runs into this: My workaround is to require open-uri and change load_uri!(url, opts) to add_block!(open(url).read, opts). It's not pretty, but it works for my purposes.

duckinator commented 11 years ago

Okay, apparently I just fail at using Google sometimes. Looks like you want uri.request_uri instead of uri.path.

duckinator commented 11 years ago

Sorry for the issue-spam. Didn't realize how simple of a fix it was when I originally opened this one. Closing because #41 has a fix.