If there are double quotes in the url, Firefox escapes them to %22 but Internet explorer gives \", which when proxied to Mongrel results in an HTTP parse error. Is there a RewriteRule or something I can employ to fix this? I''m dying here! -- Posted via http://www.ruby-forum.com/.
I submitted a patch for this behavior, you can find it here http://rubyforge.org/tracker/index.php?func=detail&aid=15664&group_id=1306&atid=5145 the patch was applied and the ticket closed, however the patch was rolled back in mongrel 1.1.3 Cheers Dave On 07/02/2008, at 10:24 AM, Brad Carson wrote:> If there are double quotes in the url, Firefox escapes them to %22 but > Internet explorer gives \", which when proxied to Mongrel results in > an > HTTP parse error. > > Is there a RewriteRule or something I can employ to fix this? I''m > dying > here! > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
I ran into this last year and patched the ragel parser to allow quotes, but it looks like it never made it to trunk. http://rubyforge.org/pipermail/mongrel-users/2006-October/001847.html It''s out of spec, so I''m guessing that''s the reason it never made it in. Apache, nginx and lighttpd all handle quotes transparently, however. So you can do it with rewrite rules, but it''s a tad hairy. This might work for you (not tested): RewriteCond %{QUERY_STRING} ^([^"]+)"(.*) RewriteRule ^/(.*) /$1\?%1\%22%2 [N] And, this works in nginx (for up to 3 quotes, before the location block): if ($args ~ ^([^\"]+)\"(.*)$) { set $args $1%22$2; } if ($args ~ ^([^\"]+)\"(.*)$) { set $args $1%22$2; } if ($args ~ ^([^\"]+)\"(.*)$) { set $args $1%22$2; } if ($args) { rewrite ^/(.*) /$1?$args last; } This doesn''t handle quotes in the path part of the uri however. On Feb 7, 2008, at 8:08 AM, Dave Cheney wrote:> I submitted a patch for this behavior, you can find it here > > http://rubyforge.org/tracker/index.php?func=detail&aid=15664&group_id=1306&atid=5145 > > the patch was applied and the ticket closed, however the patch was > rolled back in mongrel 1.1.3 > > Cheers > > Dave > > On 07/02/2008, at 10:24 AM, Brad Carson wrote: > >> If there are double quotes in the url, Firefox escapes them to %22 >> but >> Internet explorer gives \", which when proxied to Mongrel results in >> an >> HTTP parse error. >> >> Is there a RewriteRule or something I can employ to fix this? I''m >> dying >> here! >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Mongrel-users mailing list >> Mongrel-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/mongrel-users > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users
Eden Li wrote:> It''s out of spec, so I''m guessing that''s the reason it never made it > in. Apache, nginx and lighttpd all handle quotes transparently, > however. So you can do it with rewrite rules, but it''s a tad hairy. > This might work for you (not tested): > > RewriteCond %{QUERY_STRING} ^([^"]+)"(.*) > RewriteRule ^/(.*) /$1\?%1\%22%2 [N]Eden, thank you, that''s great. I''ve found it only works for the first " in Apache. The double quotes in the URL are coming from a 3rd party, so I''m going to try my best to get them to properly escape their URLs. Otherwise, is it possible to make a Rewrite rule to escape all the double quotes properly if a request is coming from IE? Many thanks. -- Posted via http://www.ruby-forum.com/.
> Eden, thank you, that''s great. I''ve found it only works for the first " > in Apache.Never mind, I''m mistaken and understand what''s happening now. Thanks, I owe you one! -- Posted via http://www.ruby-forum.com/.