- 07 10月, 2015 5 次提交
-
-
由 Aaron Patterson 提交于
Use the methods rack provides so we don't have to worry about the exact header key.
-
由 Aaron Patterson 提交于
Rack implements the Etag header manipulation methods, so we can use those instead of ours.
-
由 Jeremy Daer 提交于
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. efc6dd55
-
由 tanmay3011 提交于
-
由 Abhishek Jain 提交于
-
- 06 10月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
Just a slight refactor that delegates file sending to the response object. This gives us the advantage that if a webserver (in the future) provides a response object that knows how to do accelerated file serving, it can implement this method.
-
- 04 10月, 2015 1 次提交
-
-
由 Jeremy Daer 提交于
* Introduce `ActionDispatch::Http::Headers#add` to add a value to a multivalued header. * Move `Response#add_header` upstream: https://github.com/rack/rack/pull/957 * Match upstream `Response#have_header?` -> `#has_header?` name change.
-
- 02 10月, 2015 2 次提交
-
-
由 Jeremy Daer 提交于
-
由 Jeremy Daer 提交于
-
- 29 9月, 2015 2 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 4147ab73.
-
由 Gaurav Sharma 提交于
-
- 28 9月, 2015 1 次提交
-
-
由 Ronak Jangir 提交于
-
- 26 9月, 2015 5 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
We only want to activate flash when the user has enabled it. Api servers don't use flash, so add an empty implementation to the base Request object.
-
由 Aaron Patterson 提交于
Committing the flash needs to happen in order for the session to be written correctly, so lets guarantee that it actually does happen.
-
由 Aaron Patterson 提交于
I'm doing this so that we can commit the flash to the session object Out of Band of the flash middleware
-
由 Gaurav Sharma 提交于
-
- 25 9月, 2015 4 次提交
-
-
由 amitkumarsuroliya 提交于
Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
-
由 Aaron Patterson 提交于
Use the Rack utility methods for functional header manipulation. This helps to eliminate coupling on the header hash
-
由 Aaron Patterson 提交于
I want to move the header hash to the super request object in order to consolidate behavior. We should be switching out buffering strategies rather than header strategies since things like "mutating headers after send" is an error in both cases (buffering vs streaming).
-
由 Aaron Patterson 提交于
We should not mutate headers after the response has been committed.
-
- 24 9月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
I'm making this change so that I can construct response objects that *don't* have the default headers applied. For example, I would like to construct a response object from the return value of a controller. If you need to construct a response object with the default headers, then please use the alternate constructor: `ActionDispatch::Response.create`
-
- 23 9月, 2015 3 次提交
-
-
由 amitkumarsuroliya 提交于
As we all know that Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
-
由 Aaron Patterson 提交于
The flash middleware shouldn't know how to look up the session object. Just ask the request for that information.
-
由 Aaron Patterson 提交于
We can know whether or not there is a content type object, and just exit early. There is no need to `try` so hard.
-
- 22 9月, 2015 9 次提交
-
-
由 Aaron Patterson 提交于
Synonyms are always a list of strings, and we have access to the internal string representation, so we can avoid allocating new arrays.
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
Now that `all` has it's own object, we don't need the html_types Set.
-
由 Aaron Patterson 提交于
This class gives us the `all?` predicate method that returns true without hitting method missing
-
由 Aaron Patterson 提交于
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?`.
-
由 Aaron Patterson 提交于
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.
-
由 Aaron Patterson 提交于
We should be asking the mime type method for the mime objects rather than via const lookup
-
由 Aaron Patterson 提交于
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]
-
由 Aaron Patterson 提交于
Now we don't have to look it up with a `const_get`.
-
- 21 9月, 2015 2 次提交
-
-
由 Harry V. Kiselev 提交于
forgotten end of the block
-
由 Akira Matsuda 提交于
-
- 19 9月, 2015 4 次提交
-
-
由 Aaron Patterson 提交于
This is an instance method on the request object now so we don't need it anymore
-
由 Aaron Patterson 提交于
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.
-
由 Aaron Patterson 提交于
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).
-
由 Aaron Patterson 提交于
Parameters will not be parsed until they are specifically requested via the `request_parameters` method.
-