1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

18 commits

Author SHA1 Message Date
Genadi Samokovarov
998d03fddb Refactor ActionDispatch::Http::Parameters#normalize_encode_params 2013-06-04 13:42:40 +03:00
Nihad Abbasov
b0f1cd8719 use constant for encoding 2013-05-02 04:45:47 +05:00
Teo Hui Ming
b307210d49 UTF-8 encode all keys and values in nested params hash. 2013-03-15 09:17:03 +08:00
Vipul A M
0c61d97ac1 Change from each to each_value in http/parameters since we don't use key 2013-03-13 08:52:07 +05:30
Akira Matsuda
5f30b547c8 Use Encoding::UTF_8 constant 🚯 2013-01-28 17:06:02 +09:00
Akira Matsuda
c8e632bd9f Namespace HashWithIndifferentAccess 2013-01-07 07:37:23 +09:00
Adam Stankiewicz
bc254cc235 Prevent raising EOFError on multipart GET request.
Such request can happen on Internet Explorer. When we redirect
after multipart form submission, the request type is changed
to GET, but Content-Type is preserved as multipart. GET request
cannot have multipart body and that caused Rails to fail.

It's similar fix to Rack's one:
8025a4ae94/lib/rack/request.rb (L224)
2012-12-10 21:23:59 +01:00
Aaron Patterson
6a3d4695f0 initialize instance variables 2012-08-09 11:21:58 -07:00
Andrew White
5603050656 Reset the request parameters after a constraints check
A callable object passed as a constraint for a route may access the request
parameters as part of its check. This causes the combined parameters hash
to be cached in the environment hash. If the constraint fails then any subsequent
access of the request parameters will be against that stale hash.

To fix this we delete the cache after every call to `matches?`. This may have a
negative performance impact if the contraint wraps a large number of routes as the
parameters hash is built by merging GET, POST and path parameters.

Fixes #2510.
2012-05-02 23:58:40 +01:00
Sergey Nartimov
5ca86ac8f9 deprecate String#encoding_aware? and remove its usage 2011-12-24 15:57:54 +03:00
Andrew White
11f6179f55 Reset symbolized path parameters when a test request is recycled [#5437 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-24 11:24:32 -03:00
Andrew White
ae2c60734a Cache the symbolized path parameters using a instance variable in the request object rather than the environment hash. This it to prevent stale parameters in later routing constraints/redirects as only the normal path parameters are set by Rack::Mount.
Also if a constraint proc arity is more than one, pass the symbolized path parameters
as the first argument to match redirect proc args and provide easier access.

[#5157 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-22 16:17:26 -03:00
wycats
25215d7285 Fix several known web encoding issues:
* Specify accept-charset on all forms. All recent browsers,
  as well as IE5+, will use the encoding specified for form
  parameters
* Unfortunately, IE5+ will not look at accept-charset unless
  at least one character in the form's values is not in the
  page's charset. Since the user can override the default
  charset (which Rails sets to UTF-8), we provide a hidden
  input containing a unicode character, forcing IE to look
  at the accept-charset.
* Now that the vast majority of web input is UTF-8, we set
  the inbound parameters to UTF-8. This will eliminate many
  cases of incompatible encodings between ASCII-8BIT and
  UTF-8.
* You can safely ignore params[:_snowman_]

TODO:

* Validate inbound text to confirm it is UTF-8
* Combine the whole_form implementations in form_helper_test
  and form_tag_helper_test
2010-06-27 21:13:55 -07:00
Evgeniy Dolzhenko
ccf9577aee Fix a bunch of minor spelling mistakes 2010-06-11 14:15:34 +04:00
Santiago Pastorino
961aa70e4a Some require indifferent_access added
Signed-off-by: Xavier Noria <fxn@ubuntu.(none)>
2010-04-21 07:45:29 -07:00
Prem Sichanugrist
bd4f21fbac Move filter_parameter_logging logic out of the controller and create ActionDispatch::ParametersFilter to handle parameter filteration instead. This will make filteration not depending on controller anymore.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-01-21 10:08:26 +01:00
Joshua Peek
87bcf1aa15 Request#filter_parameters and filter_env 2010-01-20 09:55:58 -06:00
José Valim
92f49b5f1e Split ActionDispatch http in smaller chunks. 2010-01-16 15:45:07 +01:00