| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Support for this header was removed when `actionpack-xml_parser` was
extracted, and has since been dropped from the gem.
|
| |
|
|
|
|
|
| |
This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f,
d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When puma/puma#1403 is merged Puma will support the Early Hints status
code for sending assets before a request has finished.
While the Early Hints spec is still in draft, this PR prepares Rails to
allowing this status code.
If the proxy server supports Early Hints, it will send H2 pushes to the
client.
This PR adds a method for setting Early Hints Link headers via Rails,
and also automatically sends Early Hints if supported from the
`stylesheet_link_tag` and the `javascript_include_tag`.
Once puma supports Early Hints the `--early-hints` argument can be
passed to the server to enable this or set in the puma config with
`early_hints(true)`. Note that for Early Hints to work
in the browser the requirements are 1) a proxy that can handle H2,
and 2) HTTPS.
To start the server with Early Hints enabled pass `--early-hints` to
`rails s`.
This has been verified to work with h2o, Puma, and Rails with Chrome.
The commit adds a new option to the rails server to enable early hints
for Puma.
Early Hints spec:
https://tools.ietf.org/html/draft-ietf-httpbis-early-hints-04
[Eileen M. Uchitelle, Aaron Patterson]
|
|\
| |
| | |
Normalize/process Cache-Control headers consistently
|
| |
| |
| |
| |
| |
| | |
The prior logic explictly set `Cache-Control` to `nil`. But, we would only
reach that logic if the header was not set to begin with. So, rather than give
it any value at all, just leave it alone.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The prior logic was trying to do too many things at once. For all responses,
we want to perform two distinct steps:
* Merge/normalize the `Cache-Control` values found in HTTP headers and those
found in the `@cache_control` hash.
* Conditionally set a default `Cache-Control` header value when we have an ETag
This change separates these concerns since the merge/normalize step should
occur for all responses, but the second should only occur when we have already
set an ETag/last modified value. Normally ETag middleware will set a default
`Cache-Control`, but only if an existing ETag is not already set. So, in the
cases where an ETag is set, we need to set the default `Cache-Control` value
ourselves.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In the existing logic, the `Cache-Control` header may or may not get
normalized by additional logic depending on whether `response.cache_conrol`
has been modified. This leads to inconsistent behavior, since sometimes
`Cache-Control` can contain whatever a user sets and sometimes it gets
normalized, based on the logic inside of `set_conditional_cache_control!`. It
seems like this normalization process should happen regardless to ensure
consistent behavior.
|
|/ |
|
| |
|
|\
| |
| | |
Refactoring `Response#charset=`
|
| | |
|
| |
| |
| |
| |
| |
| | |
By this commit, `#set_header` is called only via
`#set_content_type`. This commit makes the role of
`#charset=` more clear.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit changes the behavior such the path_params now default to
UTF8 just like regular parameters. This also changes the behavior such
that if a path parameter contains invalid UTF8 it returns a 400 bad
request. Previously the behavior was to encode the path params as binary
but that's not the same as query params.
So this commit makes path params behave the same as query params.
It's important to test with a path that's encoded as binary because
that's how paths are encoded from the socket. The test that was altered
was changed to make the behavior for bad encoding the same as query
params. We want to treat path params the same as query params. The params
in the test are invalid UTF8 so they should return a bad request.
Fixes #29669
*Eileen M. Uchitelle, Aaron Patterson, & Tsukuru Tanimichi*
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |\
| | |
| | |
| | | |
Enforce frozen string in Rubocop
|
| | | |
|
| |\ \
| | |/
| |/|
| | | |
Make ActiveSupport frozen-string-literal friendly.
|
| | | |
|
|/ / |
|
|\| |
|
| | |
|
|\| |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When you have a route that points to an nonexistent controller we raise
an exception.
This exception was being caught by the DebugExceptions middleware in
development, but when trying to render the error page, we are reading
the request format[[1][]]. To determine the request format we are reading
the format parameters[[2][]], and to be able to read the parameters we need
to encode them[[3][]]. This was raising another exception that to encode the
parameter we try to load the controller to determine if we need to
encode the parameters are binary[[4][]]. This new exception inside the
DebugExceptions middleware makes Rails to render a generic error page.
To avoid this new exception now we only encode the parameters when the
controller can be loaded.
Fixes #28892
[1]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb#L80
[2]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/http/mime_negotiation.rb#L63
[3]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/http/parameters.rb#L58
[4]: https://github.com/rails/rails/blob/f52cdaac6336f99d13622ff9bda556a3124a4121/actionpack/lib/action_dispatch/http/parameters.rb#L88
|
| |
| |
| |
| |
| |
| |
| | |
Follow up of 03d3f036.
Some of `respond_to?` were replaced to `respond_to_missing?` in 03d3f036.
But the visibility is still public. It should be private.
|
|\| |
|
| |\
| | |
| | | |
Change AD::ParamsParser::ParseError deprecation so it can be rescued
|
| | |
| | |
| | |
| | | |
Fixes #28525
|
| |/
| |
| |
| |
| |
| | |
Tried to make the sentence read more clearly.
[ci skip]
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
to be Hash
- Fixes issue described on #27944
- `filtered_query_string` used an Array representation of what
semantically is a key value pair: better suited for a Hash. Without
this change `filtered_params = original_params.class.new` returns an
Array with unintended consequences.
|
|
|
|
| |
- This file is no more needed, the call to `cattr_reader` were removed in https://github.com/rails/rails/commit/9e2948e750fa3f641f20adad4b4ecae89b35faa7#diff-c5146df11f35304765e9ceebed108f57L60 and https://github.com/rails/rails/commit/1fe0a1b5ebebb1372968606b85ce08b93bc145c8#diff-c5146df11f35304765e9ceebed108f57L99
|
|
|
|
| |
call `super`
|
| |
|
|
|
|
| |
than a ruby encoding
|
|
|
|
|
|
|
| |
It is the proper way to configure custom parameters parser and it was
being recommended in the deprecation for ActionDispatch::ParamsParser.
[ci skip]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Documentation for ActionDispatch::Request#key? [ci skip]
Update request.rb --ci skip
Documentation for ActionDispatch::Request#key? [ci skip]
Also made change after the review by @rafaelfranca .
Update request.rb --ci skip
Documentation for ActionDispatch::Request#key? [ci skip]
Also made change after the review by @rafaelfranca .
Update request.rb --ci skip
|
| |
|
| |
|
| |
|