aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
Commit message (Collapse)AuthorAgeFilesLines
* Extract `Date` header to string constant in Http Response, similar to other ↵Vipul A M2015-01-141-3/+4
| | | | headers
* Remove unneeded requiresRafael Mendonça França2015-01-041-1/+0
| | | | These requires were added only to change deprecation message
* Remove deprecated `ActionDispatch::Response#to_ary`Rafael Mendonça França2015-01-041-15/+0
|
* Remove deprecated `ActionDispatch::Request#deep_munge`Rafael Mendonça França2015-01-041-9/+0
|
* Remove deprecated `ActionDispatch::Http::Parameters#symbolized_path_parameters`Rafael Mendonça França2015-01-041-8/+0
|
* stop referencing `env` in url_forAaron Patterson2014-12-301-0/+4
| | | | | encapsulate env in the request so that we can eventually move away from the env hash
* use methods on the request rather than direct hash accessAaron Patterson2014-12-301-0/+8
| | | | this will help decouple us from using the rack env hash
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-12-201-0/+109
|\
| * Add docs for ActionDispatch::Http::URL methodsclaudiob2014-12-181-0/+109
| | | | | | | | | | | | | | | | | | | | Add docs for `extract_domain`, `extract_subdomains`, `extract_subdomain`. Add doc examples for `url`, `protocol`, `raw_host_with_port`, `host`, `host_with_port`, `port`, `standard_port`, `standard_port?`, `optional_port`, `port_string`. [ci skip]
* | allow reseting of request variantsTimo Schilling2014-12-161-1/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | The current implementation of `variants=` don't allow a resetting to nil, wich is the default value. This results in the following code smell: ```ruby case request.user_agent when /iPhone/ request.variants = :phone when /iPad/ request.variants = :ipad end ``` With the ability to reset variants to nil, it could be: ```ruby request.variants = case request.user_agent when /iPhone/ :phone when /iPad/ :ipad end ```
* ParameterFilter shouldn't try to dup symbol keysNate Berkopec2014-12-131-1/+1
|
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* Anchor should not be appended when set to nil/false.Guo Xiang Tan2014-11-231-1/+3
| | | | Fixes https://github.com/rails/rails/issues/17714.
* edit pass over all warningsXavier Noria2014-10-283-5/+5
| | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* let's warn with heredocsXavier Noria2014-10-281-1/+7
| | | | | | | | | | | | The current style for warning messages without newlines uses concatenation of string literals with manual trailing spaces where needed. Heredocs have better readability, and with `squish` we can still produce a single line. This is a similar use case to the one that motivated defining `strip_heredoc`, heredocs are super clean.
* remove duplicate method (_status_code) in action_dispatchAbdelkader Boudih2014-10-191-3/+0
|
* Make _status_code methods nodocPrathamesh Sonpatki2014-10-191-1/+1
| | | | | - Also one minor change for documenting url_for method in ActionController::Metal. [ci skip]
* Request#check_method no longer breaks when :en is not available localeStefan Henzen2014-10-091-1/+1
| | | | | | | | Request#check_method would use to_sentence(locale: :en), which breaks when I18n.available_locales does not include :en and I18n.enforce_available_locales is true (default). Inlined to_sentence functionality to solve this.
* Rescue Rack::Utils::ParameterTypeError instead of TypeErrorYuki Nishijima2014-09-131-2/+2
| | | | | | | | As of rack/rack@167b6480235ff00ed5f355698bf00ec2f250f72e, Rack raises Rack::Utils::ParameterTypeError which inherits TypeError. In terms of the behavior, Rescuing TypeError still works but this method shouldn't rescue if TypeError is raised for other reasons.
* [ci skip]Correct variables in the sample codesuginoy2014-09-101-2/+2
|
* Add support for Rack::ContentLength middelwareJavan Makhmali2014-09-061-0/+4
|
* Deprecate implicit AD::Response splatting and Array conversionJeremy Kemper2014-09-061-2/+13
|
* Avoid duplicating routes for HEAD requests.Guo Xiang Tan2014-08-211-0/+6
| | | | | | | | Follow up to rails#15321 Instead of duplicating the routes, we will first match the HEAD request to HEAD routes. If no match is found, we will then map the HEAD request to GET routes.
* Protect against error when parsing parameters with Bad RequestRafael Mendonça França2014-08-191-2/+2
| | | | Related with #11795.
* use 'based on' instead of 'based off' [ci skip]Akshay Vishnoi2014-08-121-1/+1
|
* Realign assignments :scissors:Carlos Antonio da Silva2014-07-311-5/+5
|
* Do not reassign variable when mutation is happeningCarlos Antonio da Silva2014-07-311-8/+5
| | | | | These methods mutate the path variable/argument so there is no need to reassign it every time.
* Only concatenate path if it was given rather than converting blindlyCarlos Antonio da Silva2014-07-311-1/+1
|
* Rename variable to better show its intentCarlos Antonio da Silva2014-07-311-12/+12
|
* Simplify conditionalCarlos Antonio da Silva2014-07-311-3/+2
|
* Push options check up so we can simplify internal methodsCarlos Antonio da Silva2014-07-311-13/+10
|
* LOCALHOST definition should match any 127.0.0.0/8 addressEarl J St Sauver2014-07-181-1/+1
| | | | | | | | | | | | | | | The entire 127.0.0.0/8 range is assigned to the loopback address, not only 127.0.0.0/24. This patch allows ActionDispatch::Request::LOCALHOST to match any IPv4 127.0.0.0/8 loopback address. The only place that the #local? method was previously under test was in the show_expectations_test.rb file. I don't particularly like that that's implicitly where this code is under test, and I feel like I should move some of that testing code into the test/dispatch/request_test.rb file, but I wanted some feedback first. Credit goes to @sriedel for discovering the issue and adding the patch.
* use a strategy object for generating urls in named helpersAaron Patterson2014-07-171-8/+13
| | | | | | since we know that the route should be a path or fully qualified, we can pass a strategy object that handles generation. This allows us to eliminate an "if only_path" branch when generating urls.
* extract path building to a methodAaron Patterson2014-07-161-9/+11
|
* break out path building logic to methodsAaron Patterson2014-07-161-14/+22
|
* only extract :params from the options hash onceAaron Patterson2014-07-161-3/+2
|
* always transcode the file to utf-8Aaron Patterson2014-07-161-0/+1
| | | | | | people may be passing filenames to the constructor that are not utf-8, but they will assome that calling `original_filename` returns utf-8 (because that's what it used to do).
* rack 1.6 encodes the filenames in posts correctly nowAaron Patterson2014-07-151-8/+1
|
* Merge pull request #13999 from jamox/update_rackAaron Patterson2014-07-082-12/+11
|\ | | | | This updates rails to use edge rack
| * Since upgrading rack we can remove unnecessary string encodingsJarmo Isotalo2014-05-191-9/+2
| | | | | | | | https://github.com/rack/rack/commit/5a5aee36
| * Upgraded rackJarmo Isotalo2014-05-191-3/+9
| | | | | | | | | | | | | | | | As Rack has some non backwards compatible changes added required modifications to keep behaviour in rails close to same as before. Also modified generators to include rack/rack for not yet released version of rack
* | Remove symbolized_path_parameters.Guo Xiang Tan2014-07-021-3/+4
| | | | | | | | This pull request is a continuation of https://github.com/rails/rails/commit/925bd975 and https://github.com/rails/rails/commit/8d8ebe3d.
* | makes it sound less misleadingShunsukeAida2014-07-021-2/+2
| |
* | push host / port / protocol extraction upAaron Patterson2014-06-301-6/+6
| | | | | | | | Then we only need to extract host once.
* | add both branches to the only_path conditionalAaron Patterson2014-06-191-6/+6
| |
* | Change Http::Cache::SPECIAL_KEYS from Array to SetMindaugas Mozūras2014-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slightly improves performance, for example, a simple benchmark: ```ruby require 'benchmark/ips' require 'set' SPECIAL_KEYS = %w[extras no-cache max-age public must-revalidate] SPECIAL_KEYS_SET = Set.new(SPECIAL_KEYS) directive = 'must-revalidate' Benchmark.ips do |x| x.report('array') { SPECIAL_KEYS.include?(directive) } x.report('set') { SPECIAL_KEYS_SET.include?(directive) } end ``` Output: ``` ------------------------------------- array 67926 i/100ms set 74054 i/100ms ------------------------------------- array 2318423.4 (±2.8%) i/s - 11615346 in 5.014899s set 3387981.8 (±4.7%) i/s - 16958366 in 5.019355s ```
* | only check named_host? once in normalize_hostAaron Patterson2014-06-121-3/+7
| |
* | lookup subdomain from the options hash once, defaulting to trueAaron Patterson2014-06-121-2/+2
| | | | | | | | | | if the subdomain wasn't specified, it's the same as if specifying :subdomain as `true`, so we can default the value to `true` safely.
* | only extract domain from the options hash onceAaron Patterson2014-06-121-3/+4
| |
* | reduce calls to `named_host?`Aaron Patterson2014-06-121-2/+6
| | | | | | | | | | `normalize_host` already calls `named_host?`, so there is no reason to test `named_host?` again in the `extract_domain` method.