aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Renamed ‘Return’ to ‘Returns’ [ci skip]Ronak Jangir2015-09-282-3/+3
| | | | |
| * | | | [ci skip] Fix document of `ActionController::RequestForgeryProtection`yui-knk2015-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | * add `end` to end of class definition * add a blank line between explanation and example code
* | | | | Introduce `Headers#add`. Move `Response#add_header` upstream.Jeremy Daer2015-10-035-33/+36
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | | Response#add_header for adding to multi-valued headers like VaryJeremy Daer2015-10-012-0/+79
| | | |
* | | | Don't set a nil Set-Cookie header when there aren't any cookies. Omit the ↵Jeremy Daer2015-10-012-75/+96
| | | | | | | | | | | | | | | | header.
* | | | adding test for content type with default charsetGaurav Sharma2015-10-021-1/+11
| | | | | | | | | | | | | | | | | | | | * first test is for `default_charset` i.e `ActionDispatch::Response.default_charset = “utf-8”` * In below test we are passing `ActionDispatch::Response.default_charset = 'utf-16’` so name of the test is irrelevant — “read content type without charset”
* | | | Remove TestRouter#add_routesakihiro172015-09-291-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | Now, we use the mapper to build the routing table related to https://github.com/rails/rails/commit/703275ba70efbefb3358052b6ba750443eff1a28
* | | | remove useless methodAaron Patterson2015-09-281-4/+0
| | | | | | | | | | | | | | | | | | | | the caller of `handle_conditional_get!` checks the committed state of the response, so we don't need to in the subclass.
* | | | Added test case for deprecation of Mime.const_defined? and removed use of it.Ronak Jangir2015-09-271-1/+5
| | | |
* | | | Merge pull request #21768 from Gaurav2728/gaurav-doc_fix_for_mimeRafael Mendonça França2015-09-252-4/+4
|\ \ \ \ | | | | | | | | | | fix Mime type in doc since mime types via constants is deprecated [ci…
| * | | | fix Mime type in doc since mime types via constants is deprecated [ci skip]Gaurav Sharma2015-09-262-4/+4
| | | | |
* | | | | inherit from our AbstractStoreAaron Patterson2015-09-251-5/+1
| | | | |
* | | | | pull the flash methods in to their own moduleAaron Patterson2015-09-252-34/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | commit the flash after the controller finishes being servicedAaron Patterson2015-09-253-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Committing the flash needs to happen in order for the session to be written correctly, so lets guarantee that it actually does happen.
* | | | | move flash committing to the request object.Aaron Patterson2015-09-252-12/+16
|/ / / / | | | | | | | | | | | | | | | | I'm doing this so that we can commit the flash to the session object Out of Band of the flash middleware
* | | | Fix deprecated mime types via constantsamitkumarsuroliya2015-09-251-5/+5
| | | | | | | | | | | | Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
* | | | build the Set-Cookie header functionallyAaron Patterson2015-09-241-5/+18
| | | | | | | | | | | | | | | | | | | | Use the Rack utility methods for functional header manipulation. This helps to eliminate coupling on the header hash
* | | | move the Header hash to the super classAaron Patterson2015-09-242-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | mutate headers before committing the responseAaron Patterson2015-09-241-2/+8
| | | | | | | | | | | | | | | | We should not mutate headers after the response has been committed.
* | | | call `get` instead of controller.processAaron Patterson2015-09-231-12/+10
| | | | | | | | | | | | | | | | | | | | we want the request to go through the test harness, not directly call the methods on the controller
* | | | remove controller constructionAaron Patterson2015-09-231-8/+4
| | | | | | | | | | | | | | | | also remove req / res references
* | | | stop directly referencing the request and response objectsAaron Patterson2015-09-231-23/+21
| | | |
* | | | test framework allocates the controller for usAaron Patterson2015-09-231-1/+0
| | | |
* | | | type of response should not matterAaron Patterson2015-09-231-6/+0
| | | |
* | | | don't touch the response object until after we call `get`Aaron Patterson2015-09-231-5/+2
| | | |
* | | | stop directly setting headers on the controllerAaron Patterson2015-09-232-14/+1
| | | | | | | | | | | | | | | | | | | | again, since we are going through the test harness, all this is done for us.
* | | | stop constructing a request object in this setterAaron Patterson2015-09-231-1/+0
| | | | | | | | | | | | | | | | | | | | Since we just go through the normal test harness that sets up a request for us, we don't need to do this anymore.
* | | | test against controller responsesAaron Patterson2015-09-231-52/+65
| | | | | | | | | | | | | | | | | | | | | | | | rather than calling methods on the controller. We should test the values returned by the controller rather than assuming that the internals are implemented in a certain way.
* | | | stop applying default headers in ActionDispatch::ResponseAaron Patterson2015-09-237-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`
* | | | Merge pull request #21736 from eliotsykes/document-bearer-prefixKasper Timm Hansen2015-09-231-5/+7
|\ \ \ \ | | | | | | | | | | Document Bearer prefix for Authorization header [ci skip]
| * | | | Document Bearer prefix for Authorization header [ci skip]Eliot Sykes2015-09-231-5/+7
| | | | |
* | | | | don't access the response object before a request was madeAaron Patterson2015-09-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | split cookie testsAaron Patterson2015-09-231-1/+6
| | | | | | | | | | | | | | | | | | | | these should really be multiple tests.
* | | | | don't mutate a response object after to_aAaron Patterson2015-09-231-0/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | 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).
* | | | Updated Mime Negotiations docs [ci skip]amitkumarsuroliya2015-09-232-6/+6
| | | | | | | | | | | | As we all know that Accessing mime types via constants is deprecated. Now, we are using `Mime::Type[:JSON]` instead of `Mime::JSON`
* | | | ask the request object for the sessionAaron Patterson2015-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | The flash middleware shouldn't know how to look up the session object. Just ask the request for that information.
* | | | don't deal with `nil` valuesAaron Patterson2015-09-222-1/+7
| | | | | | | | | | | | | | | | | | | | We can know whether or not there is a content type object, and just exit early. There is no need to `try` so hard.
* | | | Fix a typo: Mime::Types should be Mime::Type [ci skip]Juanito Fatas2015-09-221-1/+1
| | | |
* | | | Merge pull request #21703 from ronakjangir47/redirect_error_messagesJeremy Daer2015-09-211-2/+4
|\ \ \ \ | | | | | | | | | | Added assertion for error messages for redirection to nil and params
| * | | | Added assertion for error messages for redirection to nil and params Ronak Jangir2015-09-211-2/+4
| | | | | | | | | | | | | | | As both `redirect_to_nil` and `redirect_to_params` are raising same `ActionController::ActionControllerError` so it’s good to assert error messages as well
* | | | | drop array allocations on Mime::Type#=~Aaron Patterson2015-09-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Synonyms are always a list of strings, and we have access to the internal string representation, so we can avoid allocating new arrays.
* | | | | remove another `blank?` callAaron Patterson2015-09-211-1/+1
| | | | |
* | | | | remove html_types setAaron Patterson2015-09-212-7/+3
| | | | | | | | | | | | | | | | | | | | Now that `all` has it's own object, we don't need the html_types Set.
* | | | | introduce an `All` mime typeAaron Patterson2015-09-213-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This class gives us the `all?` predicate method that returns true without hitting method missing
* | | | | remove `blank?` calls on `==`Aaron Patterson2015-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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?`.
* | | | | change inheritance to compositionAaron Patterson2015-09-212-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | update changelog for mime changesAaron Patterson2015-09-211-0/+13
| | | | |
* | | | | swap upcase and to_symAaron Patterson2015-09-211-1/+1
| | | | |
* | | | | stop calling deprecated methodsAaron Patterson2015-09-2122-93/+93
| | | | | | | | | | | | | | | | | | | | | | | | | We should be asking the mime type method for the mime objects rather than via const lookup
* | | | | deprecate accessing mime types via constantsAaron Patterson2015-09-214-42/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]