aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/parameters.rb
Commit message (Collapse)AuthorAgeFilesLines
* Transform the mime object to symbol when registering the parsersRafael Mendonça França2016-02-221-4/+13
| | | | | This will keep our current API working without having the users to change their codebases.
* Use symbol of mime type instead of object to get correct parserMehmet Emin İNAÇ2016-02-221-2/+2
| | | | | | After registering new `:json` mime type `parsers.fetch` can't find the mime type because new mime type is not equal to old one. Using symbol of the mime type as key on parsers hash solves the problem. Closes #23766
* Remember the parameter hash we returnMatthew Draper2015-12-221-1/+1
| | | | Callers expect to be able to manipulate it.
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-2/+2
|
* Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compatJeremy Daer2015-10-061-1/+1
| | | | | | | | | | | | | | | | | Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries that support multiple Rails versions would've had to feature-detect whether to use `Mime::Type[:FOO]` or `Mime::FOO`. `Mime[:foo]` has been around for ages to look up registered MIME types by symbol / extension, though, so libraries and plugins can safely switch to that without breaking backward- or forward-compatibility. Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup by type or extension, so it's not available as `Mime[:all]`. We use it internally as a wildcard for `respond_to` negotiation. If you use this internal constant, continue to reference it with `Mime::ALL`. Ref. efc6dd550ee49e7e443f9d72785caa0f240def53
* deprecate accessing mime types via constantsAaron Patterson2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | We don't want to manage a list of constants on `Mime::`. Managing constants is strange because it will break method caches, not to mention looking up by a constant could cause troubles. For example suppose there is a top level constant `HTML`, but nobody registers the HTML mime type and someone accesses `Mime::HTML`. Instead of getting an error about how the mime type doesn't exist, instead you'll get the top level constant. So, instead of directly accessing the constants, change this: Mime::HTML To this: Mime::Type[:HTML]
* remove the request parameter from `parse_formatted_parameters`Aaron Patterson2015-09-181-5/+5
| | | | | This is an instance method on the request object now so we don't need it anymore
* push the parameter parsers on to the classAaron Patterson2015-09-181-0/+35
| | | | | | | | The middleware stack is a singleton in the application (one instance is shared for the entire application) which means that there was only one opportunity to set the parameter parsers. Since there is only one set of parameter parsers in an app, lets just configure them on the request class (since that is where they are used).
* Code cleanupMarcin Olichwirowicz2015-08-271-11/+0
| | | | | | | | Cleanup for `ActionDispatch::Http::Parameters` - no need for required libraries and remove not used private method. Apparently this method was used in `ActionDispatch::Http::Request` - fixed by calling `Request::Utils` explicitly (as was done in other parts of the codebase)
* use get / set header to avoid depending on the `env` ivarAaron Patterson2015-08-221-11/+14
|
* push param encoding in to the utils moduleAaron Patterson2015-07-211-14/+1
| | | | we'll refactor deep munge mostly out of existence shortly
* recurse for arrays in `normalize_encode_params`Aaron Patterson2015-07-211-5/+3
| | | | | this just pushes the conditional in to the case / when so we can switch to method dispatch later
* Remove deprecated `ActionDispatch::Http::Parameters#symbolized_path_parameters`Rafael Mendonça França2015-01-041-8/+0
|
* edit pass over all warningsXavier Noria2014-10-281-1/+1
| | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* Merge pull request #13999 from jamox/update_rackAaron Patterson2014-07-081-9/+2
|\ | | | | This updates rails to use edge rack
| * Since upgrading rack we can remove unnecessary string encodingsJarmo Isotalo2014-05-191-9/+2
| | | | | | | | https://github.com/rack/rack/commit/5a5aee36
* | Remove symbolized_path_parameters.Guo Xiang Tan2014-07-021-3/+4
| | | | | | | | This pull request is a continuation of https://github.com/rails/rails/commit/925bd975 and https://github.com/rails/rails/commit/8d8ebe3d.
* | Merge pull request #15349 from tgxworld/remove_duplicated_method_callRafael Mendonça França2014-06-031-1/+0
|\ \ | | | | | | Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
| * | Remove duplicated HashWithIndifferentAccess#with_indifferent_access.Guo Xiang Tan2014-05-261-1/+0
| | |
* | | rm dead codeAaron Patterson2014-05-271-5/+0
| | |
* | | PARAMETERS_KEY is only used in the request, so move the constant thereAaron Patterson2014-05-271-2/+4
| | |
* | | rm reset_parameters because we automatically do it from 9ca4839aAaron Patterson2014-05-271-4/+0
|/ /
* | just return path parametersAaron Patterson2014-05-221-2/+1
| |
* | Fix the hash key being delete from envRafael Mendonça França2014-05-221-1/+1
| | | | | | | | It was changed by mistake at c5d64b2b86aa42f57881091491ee289b3c489c7e.
* | use the existing constant rather than the hardcoded stringAaron Patterson2014-05-211-3/+3
|/ | | | | | | | | | | so tht I don't go totally insane with THsi crazy hash driven development. why is Everything a hash? Why do people think hashes in hashes with random keys is a Good API? You can't find things or deprecate them or control access whatsoever, you just have to hope that everyone is like "oh, you want to change that? that's cool! we all know it's hashes so go for it!" The End.
* Use each_with_objectSantiago Pastorino2013-08-191-4/+2
|
* Organize normalize_encoding_params' conditionals a bit better and use a case ↵Santiago Pastorino2013-08-191-15/+18
| | | | | | statement for it Refactor of the work done in #11891
* Normalize file parameters in same place as other parameters ↵robertomiranda2013-08-141-0/+2
| | | | (ActionDispatch::Http::Parameters#normalize_encode_params)
* Refactor ActionDispatch::Http::Parameters#normalize_encode_paramsGenadi Samokovarov2013-06-041-11/+7
|
* use constant for encodingNihad Abbasov2013-05-021-1/+1
|
* UTF-8 encode all keys and values in nested params hash.Teo Hui Ming2013-03-151-25/+18
|
* Change from each to each_value in http/parameters since we don't use keyVipul A M2013-03-131-1/+1
|
* Use Encoding::UTF_8 constant :do_not_litter:Akira Matsuda2013-01-281-1/+1
|
* Namespace HashWithIndifferentAccessAkira Matsuda2013-01-071-1/+1
|
* Prevent raising EOFError on multipart GET request.Adam Stankiewicz2012-12-101-1/+5
| | | | | | | | | | 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: https://github.com/chneukirchen/rack/blob/8025a4ae9477d1e6231344c2b7d795aa9b3717b6/lib/rack/request.rb#L224
* initialize instance variablesAaron Patterson2012-08-091-0/+5
|
* Reset the request parameters after a constraints checkAndrew White2012-05-021-0/+4
| | | | | | | | | | | | | 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.
* deprecate String#encoding_aware? and remove its usageSergey Nartimov2011-12-241-2/+0
|
* Reset symbolized path parameters when a test request is recycled [#5437 ↵Andrew White2010-08-241-2/+2
| | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Cache the symbolized path parameters using a instance variable in the ↵Andrew White2010-08-221-2/+2
| | | | | | | | | | | 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>
* Fix several known web encoding issues:wycats2010-06-271-1/+30
| | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-111-1/+1
|
* Some require indifferent_access addedSantiago Pastorino2010-04-211-1/+2
| | | | Signed-off-by: Xavier Noria <fxn@ubuntu.(none)>
* Move filter_parameter_logging logic out of the controller and create ↵Prem Sichanugrist2010-01-211-23/+0
| | | | | | 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>
* Request#filter_parameters and filter_envJoshua Peek2010-01-201-2/+24
|
* Split ActionDispatch http in smaller chunks.José Valim2010-01-161-0/+50