- 22 9月, 2020 1 次提交
-
-
由 Adrianna Chang 提交于
* Add binary encoding logic into ActionDispatch::Request::Utils Moving the logic to set binary encoding into ActionDispatch::Request::Utils will allow us to encode from GET and POST in ActionDispatch::Request. * Refactor binary encoding logic - Move binary encoding calls into GET, POST and path_parameters - Remove binary encoding from ActionDispatch::Http::Request - This way, we only raise an invalid encoding exception if the controller is not requesting parameters in binary encoding * Check if encoding is valid in ActionDispatch::Request#POST and raise BadRequest if invalid * Fix multipart_params_test that has binary-encoded params containing invalid UTF-8 characters * Address PR comments * Pass action and controller to Request::Utils.set_binary_encoding [Rafael Mendonça França + Adrianna Chang]
-
- 16 9月, 2020 4 次提交
-
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Akira Matsuda 提交于
-
由 Ryuta Kamizono 提交于
https://github.com/rails/rails/commit/895134bcff294b05d6f6ebb101f60e3083ec5461#diff-7789e18ec0a61c6845755a257e6eb34fR3 https://github.com/rails/rails/commit/ee9e308f686ac1c7b0714671a1dcf1d96de87d70#diff-5e9551294914b338d923032fa904c6beR103 https://github.com/rails/rails/commit/5f63c771f7ce751fefd000470bf4ccab421988d7#diff-600d5368b55e46ed961abb4295977ac3R506 https://github.com/rails/rails/commit/48b6bacbc534d4be3fa89bc19ea83c357a20e598#diff-279ac5c088a3ee7e9f954bbc10d1b773R246 https://github.com/rails/rails/commit/49adb7f4c61de8cbb02c4a207dbd56093d99e795#diff-0cbe7171fdd7821fd5836896849141c0R111 https://github.com/rails/rails/commit/9bfe89e68ee61d9c8ed71ac98c783a7e47bdb608#diff-9c1c95b001e3680ba8a473cf23508b68R8 https://github.com/rails/rails/commit/a0f18e60900fc45eb3524ab3cdfe57be430d6016#diff-bef0ae2c16dacf77bfd2ba099af8a330R47 https://github.com/rails/rails/commit/8b4d344815655027d9f7584c0a59271dce8f1d5a#diff-09660f59aee7ec893ad609315e8843c5R18 https://github.com/rails/rails/commit/49d1b5a98dc50ca59bbfb817f90eb5c2c2645d30#diff-531e71a9d5fdc8181f38ce4416553694R107 https://github.com/rails/rails/commit/b674f04756e2e23fc18308319e4de8ff562575f4#diff-7521c0bb452244663b689e77658e63e3R98 https://github.com/rails/rails/commit/a9012af6883284a35bc5e6166507d429fe10482d#diff-60bdcf1e1954ec56d41fc4c7bd8d3e39R512 https://github.com/rails/rails/commit/6380aee182a6acb4f5062c5aa377d290e696e4b7#diff-5158c234d5e19bb1cffadcbc088400f1R262 https://github.com/rails/rails/commit/c7820d8124c854760a4d288334f185de2fb99446#diff-f4614e7ba8081c0c9e20fe64b6374228R60 https://github.com/rails/rails/commit/8df7ed3b88fc9f19446d7207a745a331893b81cd#diff-0495ed68f82d1bbde593ab5491eab24aR169 https://github.com/rails/rails/commit/6f94260ac67755fbc4d89e7dd9ba6be04abfa9e7#diff-7ecb6672f3fd37dfb79c4539395d3857R28 https://github.com/rails/rails/commit/03e44f93001db97953917e0a100c627e189e2be6#diff-e9234c4c6668852448059c0a35840bcaR185
-
- 06 9月, 2020 2 次提交
-
-
由 Petrik 提交于
Calling self in an action of a controller generates an endless stream of characters, including the request object and all instances variables. This can be frustrating when using a debugger in a controller and accidentally calling `self` generates output for a couple of seconds. This shortens inspect to only show the class name. MyController.new.inspect # => "#<MyController:0x00000000005028>"
-
由 Petrik 提交于
Calling request in an action of a controller generates an endless stream of characters, including the Rack app and middlewares. This can be frustrating when using a debugger in a controller and accidentally calling `request` generates output for a couple of seconds. Inspect on ActionDispatch::Request is shortened to the most relevant attributes and uses the same format as used for request in the logs: "#<ActionDispatch::Request POST "https://example.com/path/of/some/uri?q=1" for 1.2.3.4>"
-
- 31 8月, 2020 1 次提交
-
-
由 sandstrom 提交于
-
- 26 8月, 2020 1 次提交
-
-
由 Jack McCracken 提交于
Add documentation of Proc usage for SameSite property to configuring.md Address PR comments Co-authored-by: NAdrianna Chang <adrianna.chang@shopify.com>
-
- 11 8月, 2020 1 次提交
-
-
由 Gannon McGibbon 提交于
Allow `assert_recognizes` routing assertions to work on mounted root routes.
-
- 28 7月, 2020 1 次提交
-
-
由 Daniel Colson 提交于
`Pattern#from_sting` was introduced in bb207ea7 to support creating patterns from strings in tests (removing a conditional in the initialize method that had been there only for the sake of those tests). `Pattern#build` was introduced in 947ebe9a, and was similarly used only in tests. My understanding is that [`Mapping#path`][path] is the only place where we initialize a `Path::Pattern` in library code. Since these two methods appear to be used only in tests, this commit moves them out of the class and into a test helper. My reasoning for doing this is that I am doing some performance work that may involve a modification to how `Path::Pattern`s get initialized, and I will have more confidence in that work if I know for sure that these methods are test helpers that can be modified freely. [path]: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/mapper.rb#L192-L194
-
- 26 7月, 2020 1 次提交
-
-
由 Vitalii Khustochka 提交于
If request format is JSON, keys are converted to Strings, so we have to convert them to Symbols.
-
- 21 7月, 2020 1 次提交
-
-
由 Eugene Kenny 提交于
This would have made the correct implementation for 894ed87a more obvious.
-
- 20 7月, 2020 1 次提交
-
-
由 Loren Norman 提交于
Co-authored-by: NEugene Kenny <elkenny@gmail.com>
-
- 15 7月, 2020 1 次提交
-
-
由 eileencodes 提交于
This change ensures we're no longer using a singleton for routes because we want to change the routing table based on the controller we're testing. We don't want the routing table to be global for the Action Pack tests. Co-authored-by: NAaron Patterson <tenderlove@ruby-lang.org>
-
- 06 7月, 2020 1 次提交
-
-
由 Guo Xiang Tan 提交于
308 status code introduced in https://tools.ietf.org/html/rfc7538 preserves the request method unlike 301 status code which would convert POST requests to GET.
-
- 01 7月, 2020 1 次提交
-
-
由 Jean Boussier 提交于
-
- 30 6月, 2020 1 次提交
-
-
由 Jean Boussier 提交于
-
- 19 6月, 2020 1 次提交
-
-
由 eileencodes 提交于
The controller test case is trying to encode json parameters in the same way it encodes query parameters. However we need to encode json parameters as json. This was broken in #39534 because `generate_extras` is encoding everything into query parameters. But json parameters are in the post body and need to be treated differently than the query parameters. Followup to #39651 Aaron Patterson <tenderlove@ruby-lang.org>
-
- 18 6月, 2020 1 次提交
-
-
由 Guo Xiang Tan 提交于
-
- 17 6月, 2020 1 次提交
-
-
由 Rafael Mendonça França 提交于
[CVE-2020-8185]
-
- 16 6月, 2020 1 次提交
-
-
由 Edouard CHIN 提交于
- In #39534, `Routing::RouteSet#generate_extras` (which get called) by ActionController::TestCase now go through `path_for` which strips out all key in the options hash that have the same name as the ones defined in `RESERVED_OPTIONS`.
-
- 14 6月, 2020 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up to c07dff72. Actually it is not the cop's fault, but we mistakenly use `^`, `$`, and `\Z` in much places, the cop doesn't correct those conservatively. I've checked all those usage and replaced all safe ones.
-
- 11 6月, 2020 1 次提交
-
-
由 Étienne Barrié 提交于
This allows applications to safely upgrade to Rails 6.1 without breaking tokens while the deploy is still being rolled out.
-
- 10 6月, 2020 1 次提交
-
-
由 Jonathan Hefner 提交于
Prior to this commit, when multiple cookie domains were specified, the first domain that was a substring of the request host was chosen. This allowed, for example, the "example.com" domain to be chosen when the request host was "example.com.au" or even "myexample.com". This commit ensures a domain is chosen only if it is equal to or is a superdomain of the request host. Fixes #37760.
-
- 06 6月, 2020 1 次提交
-
-
由 eileencodes 提交于
This PR converts the route params array into an object and moves the error generation code into its own object as well. This is a refactoring of internal code to make it easier to change and simplier for internals to interface with. We have two new objects: 1) `RouteWithParams` Previously `#generate` returned an array of parameterized parts for a route. We have now turned this into an object with a `path` and a `params methods` to be able to access the parts we need. 2) `MissingRoute` `#generate` was also responsible for constructing the message for the error. We've moved this code into the new `MissingRoute` object so it does that work instead. This change makes these methods reusable throughout the code and easier for future refactoring we plan to do. Co-authored-by: NAaron Patterson <aaron.patterson@gmail.com>
-
- 01 6月, 2020 1 次提交
-
-
由 Ryan Hall 提交于
When using an external build process (webpack, grunt) it's helpful for rails to be able to serve those assets. Brotli has better compression than gzip and should eventually replace it for static assets. When using an external build process (webpack, grunt) it's helpful for rails to be able to serve those assets. Brotli has better compression than gzip and will eventually replace it for static assets.
-
- 30 5月, 2020 1 次提交
-
-
由 Petrik 提交于
Move the # outside the < > just like regular Object#inspect
-
- 28 5月, 2020 1 次提交
-
-
由 Rolandas Barysas 提交于
-
- 24 5月, 2020 1 次提交
-
-
由 fatkodima 提交于
Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops
-
- 23 5月, 2020 1 次提交
-
-
由 Petrik 提交于
The current suggestions are shown on a single line. Instead we can use some prettier formatting.
-
- 21 5月, 2020 1 次提交
-
-
The status is defined in RFC 8297 https://tools.ietf.org/html/rfc8297
-
- 20 5月, 2020 4 次提交
-
-
由 Jonathan Hefner 提交于
Fixes offense: ``` actionpack/test/journey/router_test.rb:493:37: C: Style/HashSyntax: Use the new Ruby 1.9 hash syntax. options = options.merge(:_recall => recall) ^^^^^^^^^^^ ```
-
由 Aaron Patterson 提交于
Journey is considered internal, and I would like to stop testing internals so that we are free to refactor. This commit just moves us up one more call frame with the goal if getting closer to a public API. Once we're up the stack high enough that we're testing a public API we can stop
-
由 fatkodima 提交于
-
由 eileencodes 提交于
Journey is a private API that we want to refactor. We need to stop calling methods directly on it so we're free to change the implmentation.
-
- 19 5月, 2020 2 次提交
-
-
由 Petrik 提交于
If a parameter isn't found we can suggest similar params: ``` class BooksController < ActionController::Base def create params.require(:book).require(:name) head :ok end end post :create, params: { magazine: { name: "Mjallo!" } } param is missing or the value is empty: book Did you mean? controller action magazine post :create, params: { book: { title: "Mjallo!" } } param is missing or the value is empty: name Did you mean? title ```
-
由 Vitalii Khustochka 提交于
* Update `fixture_file_upload` documentation to reflect recent changes. [ci skip] * Friendlier deprecation message for `fixture_file_upload`. Suggested change now can be copied and pasted into the code without modification.
-
- 18 5月, 2020 1 次提交
-
-
由 Petrik 提交于
If an action isn't found on a controller we can suggest similar actions: ``` The action 'indx' could not be found for SimpleController Did you mean? index ```
-
- 17 5月, 2020 1 次提交
-
-
由 Eugene Kenny 提交于
This makes it safe to replace `reject { |k, v| v.nil? }` with `compact`, even when the receiver is an `ActionController::Parameters`.
-