aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
Commit message (Collapse)AuthorAgeFilesLines
...
* | | don't deal with `nil` valuesAaron Patterson2015-09-221-0/+4
| | | | | | | | | | | | | | | We can know whether or not there is a content type object, and just exit early. There is no need to `try` so hard.
* | | 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-211-6/+2
| | | | | | | | | | | | Now that `all` has it's own object, we don't need the html_types Set.
* | | introduce an `All` mime typeAaron Patterson2015-09-212-1/+7
| | | | | | | | | | | | | | | 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-211-14/+24
| | | | | | | | | | | | | | | | | | 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.
* | | stop calling deprecated methodsAaron Patterson2015-09-213-7/+7
| | | | | | | | | | | | | | | 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-213-7/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* | | cache the new type object on the stackAaron Patterson2015-09-211-2/+2
| | | | | | | | | | | | Now we don't have to look it up with a `const_get`.
* | | remove the request parameter from `parse_formatted_parameters`Aaron Patterson2015-09-182-6/+6
| | | | | | | | | | | | | | | This is an instance method on the request object now so we don't need it anymore
* | | push the parameter parsers on to the classAaron Patterson2015-09-182-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | only wrap the strategy with exception handlingAaron Patterson2015-09-181-9/+10
| | | | | | | | | | | | | | | | | | 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.
* | | pull `normalize_encode_params` upAaron Patterson2015-09-181-2/+2
| | | | | | | | | | | | | | | `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
* | | remove the `default` parameter from the parser methodAaron Patterson2015-09-181-8/+5
| | | | | | | | | | | | | | | since there is only one "default" strategy now, we can just use the block parameter for that.
* | | move parameter parsing to the request objectAaron Patterson2015-09-181-1/+34
|/ / | | | | | | | | All parameter parsing should be on the request object because the request object is the object that we ask for parameters.
* | fewer direct env manipulationsAaron Patterson2015-09-151-1/+1
| | | | | | | | this commit removes some direct access to `env`.
* | `rack_response` should use the status it's givenAaron Patterson2015-09-141-1/+1
| |
* | mime_type will always return a stringAaron Patterson2015-09-081-2/+1
| |
* | remove `parse_content_type` parameterAaron Patterson2015-09-081-6/+7
| | | | | | | | | | This method is specifically about the content type so lets remove the parameter.
* | avoid allocations when there is no content type setAaron Patterson2015-09-081-1/+2
| | | | | | | | | | create a singleton content type that just has nils, so that we don't have to allocate a content type object all the time.
* | handle implicit rendering correctlyAaron Patterson2015-09-081-3/+4
| | | | | | | | | | | | | | If someone sets just a charset, but depends on the implicit type from rendering, this will store a strange content type header that looks like this: `; charset=blah`. This is so that when the content type header is parsed again, it will return nil for the actual type.
* | remove mime type lookups when parsing the content typeAaron Patterson2015-09-081-5/+5
| | | | | | | | | | It turns out that the response object never really cares what the mime type object is, so just use the string.
* | refactor content type settingAaron Patterson2015-09-081-44/+39
| | | | | | | | pull content-type setting to a private method to dry it up.
* | make Content-Type header the canonical location for content-type infoAaron Patterson2015-09-081-34/+50
| | | | | | | | | | Instead of storing content type information in an ivar and a header, lets move to just store the content type info in just the header.
* | pull content type parsing in to a methodAaron Patterson2015-09-081-7/+15
| | | | | | | | we'll use this method later to lazily parse content type headers.
* | stop inheriting from Rack::RequestAaron Patterson2015-09-045-11/+13
| | | | | | | | | | | | Just include the modules necessary in the Request object to implement the things we need. This should make it easier to build delegate request objects because the API is smaller
* | Merge pull request #21483 from justanshulsharma/add-ip6-addressEileen M. Uchitelle2015-09-031-1/+1
|\ \ | | | | | | [ci skip] Added localhost IPv6
| * | [ci skip] Added localhost IPv6Anshul Sharma2015-09-031-1/+1
| | |
* | | Remove not used requiresMarcin Olichwirowicz2015-09-013-4/+0
| | |
* | | Merge pull request #19788 from cmdrclueless/actionpack_http_url_ipv6Rafael Mendonça França2015-09-011-1/+1
|\ \ \ | | | | | | | | Fix broken IPv6 addresses handling
| * | | Fix broken IPv6 addresses handlingBrian Weaver2015-04-161-1/+1
| | | |
* | | | add a method for getting the http auth saltAaron Patterson2015-08-291-0/+4
| | | |
* | | | Merge pull request #21396 from rodzyn/code-cleanupGuillermo Iguaran2015-08-282-13/+2
|\ \ \ \ | | | | | | | | | | Code cleanup
| * | | | Code cleanupMarcin Olichwirowicz2015-08-272-13/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup for `ActionDispatch::Http::Parameters` - no need for required libraries and remove not used private method. Apparently this method was used in `ActionDispatch::Http::Request` - fixed by calling `Request::Utils` explicitly (as was done in other parts of the codebase)
* | | | remove dependency on `@cache_control` ivarAaron Patterson2015-08-271-6/+6
| | | | | | | | | | | | | | | | | | | | eventually we'll remove this instance variable, but this is the first step
* | | | remove `@etag` ivarAaron Patterson2015-08-271-5/+7
| | | | | | | | | | | | | | | | | | | | we're storing the value in the headers hash, so lets just store the value in one place.
* | | | use the abstract API in modulesAaron Patterson2015-08-272-14/+15
| | | | | | | | | | | | | | | | | | | | Modules should be using the API that the abstract modules use so that we can move these modules between implementations
* | | | remove useless conditionalAaron Patterson2015-08-271-2/+0
| | | | | | | | | | | | | | | | | | | | cookies are always stored as a string in the header hash, so it will not need to be joined.
* | | | implement the API required by the abstract Rack request.Aaron Patterson2015-08-271-16/+8
| | | |
* | | | use the non-hash dependent Rack utils APIAaron Patterson2015-08-271-2/+2
|/ / / | | | | | | | | | eventually we will refactor this to not know about header hashes
* | | remove redefined methodAaron Patterson2015-08-261-3/+0
| | | | | | | | | | | | | | | Rack::Response::Helpers implements this method, so we can safely remove it
* | | provide a request and response to all controllersAaron Patterson2015-08-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Controllers should always have a request and response when responding. Since we make this The Rule(tm), then controllers don't need to be somewhere in limbo between "asking a response object for a rack response" or "I, myself contain a rack response". This duality leads to conditionals spread through the codebase that we can delete: * https://github.com/rails/rails/blob/85a78d9358aa728298cd020cdc842b55c16f9549/actionpack/lib/action_controller/metal.rb#L221-L223
* | | always return a controller class from the `controller_class` methodAaron Patterson2015-08-251-6/+13
| | | | | | | | | | | | | | | now the caller can just treat it like a regular controller even though it will return a 404
* | | Remove unused block argumentsAnshul Sharma2015-08-251-1/+1
| | |
* | | remove another `@env` accessAaron Patterson2015-08-241-1/+1
| | |
* | | remove more direct access to `env`Aaron Patterson2015-08-242-3/+4
| | |
* | | fewer calls to `env`Aaron Patterson2015-08-241-2/+2
| | | | | | | | | | | | We don't want to directly access the env hash
* | | stop using `@env` in the GET / POST methodsAaron Patterson2015-08-241-2/+7
| | | | | | | | | | | | | | | I want to implement this with something besides `@env` in the future, so lets stop directly referencing it.
* | | use a request object in the session middlewareAaron Patterson2015-08-221-2/+2
| | | | | | | | | | | | | | | This commit allows us to use one request object rather than allocating multiple request objects to deal with the session.