aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Removed warning actionpack url.rbJuanito Fatas2014-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | Before: /Users/Juan/dev/rails/actionpack/lib/action_dispatch/http/url.rb:95: warning: shadowing outer local variable - port After: No warning
* | remove useless to_param callAaron Patterson2014-06-111-1/+1
| | | | | | | | | | extract_subdomain always returns a string, and to_param calls to_s on a string
* | only look up the subdomain onceAaron Patterson2014-06-111-3/+4
| |
* | scheme should contain one or more charactersAaron Patterson2014-06-111-1/+1
| |
* | pull the port out of the options hash onceAaron Patterson2014-06-111-2/+3
| |
* | remove useless nil checkAaron Patterson2014-06-111-2/+2
| | | | | | | | | | | | | | | | | | irb(main):004:0> /foo/ !~ nil => true irb(main):005:0> /foo/ !~ 'bar' => true irb(main):006:0> /foo/ !~ 'foo' => false
* | these methods are always called with a tld_parameterAaron Patterson2014-06-111-3/+3
| | | | | | | | | | remove the default parameter since the methods are always called with a parameter
* | rm `same_host?`. The same conditional is two lines down.Aaron Patterson2014-06-111-5/+3
| |
* | Revert "rm `same_host?`. The same conditional is two lines down."Aaron Patterson2014-06-111-5/+8
| | | | | | | | This reverts commit 79469b4b0c05a50e19699bc9b568042add2d4987.
* | rm `same_host?`. The same conditional is two lines down.Aaron Patterson2014-06-111-8/+5
| |
* | cache host on the stack so we only look it up onceAaron Patterson2014-06-111-8/+9
| |
* | only pull :protocol from the options hash onceAaron Patterson2014-06-111-2/+3
| |
* | cache protocol on the stack to reduce options hash lookupsAaron Patterson2014-06-111-7/+7
| |
* | eliminate nil checks in normalize_portAaron Patterson2014-06-111-7/+7
| |
* | reduce hash lookups and disconnect normalize_port from the options hashAaron Patterson2014-06-111-9/+9
| |
* | Handle client disconnect during live streamingMatthew Draper2014-06-081-13/+47
| | | | | | | | .. even when the producer is blocked for a write.
* | Use a frozen Set instance for CGI_VARIABLES.Nathaniel Bibler2014-06-051-8/+21
| | | | | | Also expand the CGI_VARIABLE name listing to multiple lines for cleaner diffs and legibility.