开发者

Rails params encoding with Passenger

开发者 https://www.devze.com 2023-03-08 18:36 出处:网络
I\'m running an app (on Dreamhost) that works fine in the development environment, but does not work properly in production.I\'ve tried eliminating every difference I could: using the same mysql insta

I'm running an app (on Dreamhost) that works fine in the development environment, but does not work properly in production. I've tried eliminating every difference I could: using the same mysql instance, for example.

The only thing I can see is that my query params seem to 开发者_如何学Cbe encoded strangely.

Here's how they look in the development instance:

This search:

GET "/individuals?utf8=%E2%9C%93&search%5Bfirstname_like%5D=&search%5Blastname_like%5D=jones&commit=Search"

Produces these params:

Parameters: {"utf8"=>"✓", "search"=>{"firstname_like"=>"", "lastname_like"=>"jones"}, "commit"=>"Search"}

In the production instance:

GET "/individuals/?utf8=%25E2%259C%2593&search%255Bfirstname_like%255D=&search%255Blastname_like%255D=jones&commit=Search"

Produces these params:

Parameters: {"commit"=>"Search", "search%5Bfirstname_like%5D"=>"", "utf8"=>"%E2%9C%93", "search%5Blastname_like%5D"=>"jones"}

The query string seems to have an extra "25" in there.

Any idea what gives?


Turns out this was an Apache "mod_rewrite" issue. I had a .htaccess file from html5boilerplate that was causing the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号