| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It doesn't make sense to access the response object before a request is
made (how was a response object created without making a request?) This
commit splits testing default headers and default header mutation tests
and removes access to the pre-request response object.
|
| | | |
| | | |
| | | |
| | | | |
these should really be multiple tests.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
When the response object is `to_a`'d, that means it's been written to
the socket. It doesn't make sense to mutate the response object after
it's been written (and this may raise an exception in the future).
|
| | |
| | |
| | | |
As we all know that Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
|
| | |
| | |
| | |
| | |
| | | |
The flash middleware shouldn't know how to look up the session object.
Just ask the request for that information.
|
| | |
| | |
| | |
| | |
| | | |
We can know whether or not there is a content type object, and just exit
early. There is no need to `try` so hard.
|
| | | |
|
|\ \ \
| | | |
| | | | |
Added assertion for error messages for redirection to nil and params
|
| | | |
| | | |
| | | | |
As both `redirect_to_nil` and `redirect_to_params` are raising same `ActionController::ActionControllerError` so it’s good to assert error messages as well
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Synonyms are always a list of strings, and we have access to the
internal string representation, so we can avoid allocating new arrays.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
Now that `all` has it's own object, we don't need the html_types Set.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This class gives us the `all?` predicate method that returns true
without hitting method missing
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Since Mime::Type implements `method_missing`, and `blank?` triggers it's
positive branch:
https://github.com/rails/rails/blob/f9dda1567ea8d5b27bd9d66ac5a8b43dc67a6b7e/actionpack/lib/action_dispatch/http/mime_type.rb#L342
We should stop calling `blank?`.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Changes `Mimes` to compose a set rather than inherit from array. With
this change we don't need to define as many methods, so ISEQ memory is
saved. Also it is clear which methods break the set cache.
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
We should be asking the mime type method for the mime objects rather
than via const lookup
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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]
|
|/ / /
| | |
| | |
| | | |
Now we don't have to look it up with a `const_get`.
|
| | |
| | |
| | | |
forgotten end of the block
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
This can still be added to the middleware stack, but is really not
necessary. I'll follow up with a commit that deprecates the constant
|
| | |
| | |
| | |
| | |
| | | |
all parameter parsing is done on the request object now, so we don't
need to worry about at ParamParser middleware
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
The test request object will handle parsing XML posts now, so we don't
need to eagerly parse them in the test harness
|
| | |
| | |
| | |
| | |
| | | |
The request object will automatically parse these in the
`parse_formatted_parameters` method, so we don't have to worry about it.
|
| | |
| | |
| | |
| | |
| | | |
This is an instance method on the request object now so we don't need it
anymore
|
| | |
| | |
| | |
| | |
| | |
| | | |
we don't actually need a param parser middleware instance since the
request object will take care of parsing parameters for us. For now,
we'll just configure the parameter parsers on the request in this class.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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).
|
| | |
| | |
| | |
| | |
| | | |
Parameters will not be parsed until they are specifically requested via
the `request_parameters` method.
|
| | |
| | |
| | |
| | |
| | |
| | | |
we need to be more specific about exception handling when dealing with
the parse strategies. The calls to `return yield` can also raise an
exception, but we don't want to handle that in *this* code.
|
| | |
| | |
| | |
| | |
| | | |
`normalize_encode_params` is common to all parser code paths, so we can
pull that up and always apply it before assigning the request parameters
|
| | |
| | |
| | |
| | |
| | | |
since there is only one "default" strategy now, we can just use the
block parameter for that.
|
|/ /
| |
| |
| |
| | |
All parameter parsing should be on the request object because the
request object is the object that we ask for parameters.
|
| | |
|
| | |
|
| |
| |
| |
| | |
this commit removes some direct access to `env`.
|
| |
| |
| |
| |
| | |
This commit is to abstract the code away from the env hash. It no
longer needs to have the routes key hard coded.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This changes the renderer class to store the controller and defaults as
an instance variable rather than allocating a new class. You can create
a new renderer with an new env by calling `Renderer#new` or use new
defaults by calling `Renderer#with_defaults` and saving the return value
somewhere.
Also I want to keep the `env` private since I would like to change the
keys in the future. This commit only translates particular keys that
the user requested.
|
| |
| |
| |
| |
| | |
this means the reader doesn't need to lock, but does have the added cost
of a new object created for every controller
|
| | |
|
| |
| |
| |
| |
| | |
The controller class is shared among threads, so we need to lock when
allocating the Renderer.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Remove wrong doc line about AC::Parameters
|
| | |
| | |
| | |
| | |
| | | |
AC::Parameters does not inherit from HashWithIndifferentAccess
since #20868 by @sikachu
|
| | |
| | |
| | |
| | |
| | | |
`Rack::Session::Abstract::ID` is now deprecated and
`Rack::Session::Abstract::Persisted` should be used instead.
|