aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/redirection.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Action Pack] require => require_relativeAkira Matsuda2017-10-211-2/+2
| | | | | This basically reverts e9fca7668b9eba82bcc832cb0061459703368397, d08da958b9ae17d4bbe4c9d7db497ece2450db5f, d1fe1dcf8ab1c0210a37c2a78c1ee52cf199a66d, and 68eaf7b4d5f2bb56d939f71c5ece2d61cf6680a3
* Use tt in doc for ActionPack [ci skip]Yoshiyuki Hirano2017-08-261-3/+3
|
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* [Action Dispatch] require => require_relativeAkira Matsuda2017-07-011-2/+2
|
* [docs] fix ActionDispatch documentationHrvoje Šimić2017-03-131-2/+2
|
* Commit flash changes when using a redirect route.Andrew White2017-02-251-0/+2
| | | | | | | | | | | | | In ca324a0 the flash middleware was effectively removed by its constructor returning the app it was passed and the `commit_flash` call was moved to the `ActionController::Metal#dispatch` method. This broke any redirect routes that modified the flash because the redirect happens before `dispatch` gets called. To fix it, this commit adds a `commit_flash` call in the `serve` method of `ActionDispatch::Routing::Redirect`. Fixes #27992.
* Add examples for behaviour about redirection with and without options. Fixes ↵Vipul A M2017-01-211-0/+8
| | | | #27715 [ci skip] (#27730)
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-4/+4
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-4/+4
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-5/+5
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-10/+10
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Check `request.path_parameters` encoding at the point they're setGrey Baker2016-07-141-1/+0
| | | | | | | | Check for any non-UTF8 characters in path parameters at the point they're set in `env`. Previously they were checked for when used to get a controller class, but this meant routes that went directly to a Rack app, or skipped controller instantiation for some other reason, had to defend against non-UTF8 characters themselves.
* whitespaceAaron Patterson2015-08-081-3/+3
|
* Revert "Merge pull request #20584 from arthurnn/fix_url"Arthur Neves2015-06-171-8/+4
| | | | | | | | This reverts commit 0b3397872582f2cf1bc6960960a6393f477c55e6, reversing changes made to 56d52e3749180e6c1dcf7166adbad967470aa78b. As pointed out on the PR, this will hide development mistakes too, which is not ideal.
* Catch InvalidURIError on bad paths on redirect.Arthur Neves2015-06-161-4/+8
| | | | | Handle URI::InvalidURIError errors on the redirect route method, so it wont raise a 500 if a bad path is given.
* remove another wasteful AS::SafeBuffer allocationAaron Patterson2014-06-061-1/+1
|
* move path_parameter encoding check to the request objectAaron Patterson2014-05-271-8/+1
|
* give all endpoints a superclassAaron Patterson2014-05-271-2/+7
|
* use symbol keys for path_parametersAaron Patterson2014-05-221-2/+2
|
* Allow engine root relative redirects using an empty string.Andrew White2014-01-011-8/+18
| | | | | | | | | | | | | | | | | | Example: # application routes.rb mount BlogEngine => '/blog' # engine routes.rb get '/welcome' => redirect('') This now redirects to the path `/blog`, whereas before it would redirect to the application root path. In the case of a path redirect or a custom redirect if the path returned contains a host then the path is treated as absolute. Similarly for option redirects, if the options hash returned contains a `:host` or `:domain` key then the path is treated as absolute. Fixes #7977
* Try to escape each part of a path redirect route correctlyAndrew White2013-12-021-8/+25
| | | | | | | | | | | | | A path redirect may contain any and all parts of a url which have different escaping rules for each part. This commit tries to escape each part correctly by splitting the string into three chunks - path (which may also include a host), query and fragment; then it applies the correct escape pattern to each part. Whilst using `URI.parse` would be better, unfortunately the possible presence of %{name} parameters in the path redirect string prevents us from using it so we have to use a regular expression instead. Fixes #13110.
* Respect `SCRIPT_NAME` when using `redirect` with a relative pathAndrew White2013-10-101-0/+18
| | | | | | | | | | | | | | | | Example: # application routes.rb mount BlogEngine => '/blog' # engine routes.rb get '/admin' => redirect('admin/dashboard') This now redirects to the path `/blog/admin/dashboard`, whereas before it would've generated an invalid url because there would be no slash between the host name and the path. It also allows redirects to work where the application is deployed to a subdirectory of a website. Fixes #7977
* Fix typos: the indefinite articles(a -> an)SUGINO Yasuhiro2013-09-131-1/+1
|
* Use merge! in some places to avoid creating extra hashesCarlos Antonio da Silva2012-11-241-1/+1
|
* Use get in the redirection doc examplesCarlos Antonio da Silva2012-11-091-7/+7
| | | | | | | get is the most common usage, and match without an explicit verb was disallowed in 56cdc81c08b1847c5c1f699810a8c3b9ac3715a6. [ci skip]
* 1.9 hash syntax changes to docsAvnerCohen2012-10-311-4/+4
|
* Return 400 Bad Request for URL paths with invalid encoding.Andrew White2012-05-201-0/+9
| | | | | | | | | Passing path parameters with invalid encoding is likely to trigger errors further on like `ArgumentError (invalid byte sequence in UTF-8)`. This will result in a 500 error whereas the better error to return is a 400 error which allows exception notification libraries to filter it out if they wish. Closes #4450
* Improve `rake routes` output for redirects - closes #6369.Andrew White2012-05-191-12/+22
|
* Fix inspecting route redirections, closes #6369Łukasz Strzałkowski2012-05-181-0/+4
| | | | | | | | | | | | This commit fixes route inspection in `rake routes` Before: foo /foo(.:format) :controller#:action" After: foo /foo(.:format) Redirect (301)
* use extract_options!Paul McMahon2012-05-031-1/+2
|
* Restore interpolation of path option in redirect routesAndrew White2012-04-291-0/+10
|
* Escape interpolated params when redirecting - fixes #5688Andrew White2012-04-291-1/+7
|
* Fix formattingOscar Del Ben2012-04-181-2/+2
|
* let's keep the slash in the return value instead of the path variable [ci skip]Vijay Dev2012-04-181-2/+2
|
* Warn about do end syntax in redirect optionOscar Del Ben2012-04-171-0/+3
|
* Fix redirect with block exampleAlexey Vakhov2012-04-171-3/+3
|
* Remove deprecation warnings from Action Pack.José Valim2011-12-201-9/+0
|
* Revert "make sure to require the right deprecation warning file"Aaron Patterson2011-11-181-1/+0
| | | | This reverts commit 9d725e3df502a07222f35576108eb2df2bd88259.
* Refactoring the redirect method for the router api.Aaron Patterson2011-11-181-25/+19
|
* moving redirection to objectsAaron Patterson2011-11-181-45/+58
|
* remove the :path feature to redirects, since it cannot workAaron Patterson2011-11-181-15/+7
|
* make sure to require the right deprecation warning fileAaron Patterson2011-11-181-0/+1
|
* arity check has been pushed up, so no need for proc wrappingAaron Patterson2011-11-181-1/+1
|
* require that all blocks have arity of 2Aaron Patterson2011-11-181-5/+10
|
* Added documentation explaining the new additional supported syntaxes for the ↵Josh Kalderimis2010-11-301-0/+29
| | | | routing redirect method, a small changelog note, and two extra tests for path interpolation when using the hash option syntax.
* The redirect routing method now allows for a hash of options which only ↵Josh Kalderimis2010-11-301-0/+81
changes the relevant parts of the url, or an object which responds to call can be supplied so common redirect rules can be easily reused. This commit includes a change where url generation from parts has been moved to AD::Http::URL as a class method.