aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/redirecting.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* [docs] fix ActionController documentationHrvoje Šimić2017-03-121-2/+2
| | | | [ci skip]
* Fix CI failure due to contain <U+2028>Ryuta Kamizono2017-03-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | ```diff diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index a3159c29dd..1836a07d4e 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -50,8 +50,8 @@ module Redirecting # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id } # redirect_to({ action: 'atom' }, alert: "Something serious happened") # - # Statements after redirect_to in our controller get executed, so redirect_to doesn't stop the execution of the function. - <U+2028># To terminate the execution of the function immediately after the redirect_to, use return. + # Statements after +redirect_to+ in our controller get executed, so +redirect_to+ doesn't stop the execution of the function. + # To terminate the execution of the function immediately after the +redirect_to+, use return. # redirect_to post_url(@post) and return def redirect_to(options = {}, response_status = {}) raise ActionControllerError.new("Cannot redirect to nil!") unless options ``` https://travis-ci.org/rails/rails/jobs/207908041#L549
* [ci skip] Use return with redirect_toChakreshwarSharma2017-03-041-0/+3
|
* Use `response#location` instead of `#location` in redirect.Mehmet Emin INAC2017-02-201-1/+1
| | | | Closes #28033
* No need to :doc: a public methodAkira Matsuda2017-01-051-1/+1
|
* remove unused `RedirectBackError` classyuuji.yaginuma2016-10-271-8/+0
| | | | Follow up to 333bfd896e87862cece95deb1ef88132d5f54ba8
* Add missing @, fix indents. [ci skip]bogdanvlviv2016-10-101-6/+6
|
* Remove deprecated support to `:back` in `redirect_to`Rafael Mendonça França2016-10-091-8/+0
|
* fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-011-1/+1
|
* Fix typo for redirect_backArkadiusz Fal2016-03-221-1/+1
| | | | | indetical -> identical [skip ci]
* Merge pull request #20797 from byroot/prevent-url-for-ac-parametersRafael França2015-12-181-1/+0
|\ | | | | Prevent ActionController::Parameters in url_for
| * Prevent ActionController::Parameters from being passed to url_for directlyJean Boussier2015-12-151-1/+0
| |
* | Document when fallback_location is used [ci-skip]Derek Prior2015-12-171-2/+8
| | | | | | | | | | | | | | | | If you're not familiar with how the `Referer` header works, you likely won't understand why you need to provide a fallback or under what circumstances it would be used. Hopefully this clarifies things a bit.
* | Deprecate `redirect_to :back`Derek Prior2015-12-161-10/+6
| | | | | | | | | | | | | | Applications that use `redirect_to :back` can be forced to 500 by clients that do not send the HTTP `Referer` (sic) header. `redirect_back` requires the user to consider this possibility up front and avoids this trivially-caused application error.
* | Add `redirect_back` for safer referrer redirectsDerek Prior2015-12-161-0/+23
|/ | | | | | | | | | | | | | | | | `redirect_to :back` is a somewhat common pattern in Rails apps, but it is not completely safe. There are a number of circumstances where HTTP referrer information is not available on the request. This happens often with bot traffic and occasionally to user traffic depending on browser security settings. When there is no referrer available on the request, `redirect_to :back` will raise `ActionController::RedirectBackError`, usually resulting in an application error. `redirect_back` takes a required `fallback_location` keyword argument that specifies the redirect when the referrer information is not available. This prevents 500 errors caused by `ActionController::RedirectBackError`.
* remove RackDelegation moduleAaron Patterson2015-08-261-1/+0
| | | | | | Since all controller instances are required to have a request and response object, RackDelegation is no longer needed (we always have to delegate to the response)
* refactor Redirecting so we do not need a controller instanceAaron Patterson2014-08-061-3/+5
|
* Don't accept parameters as argument for redirect to [via @homakov]Santiago Pastorino2014-07-161-0/+1
| | | | Closes #16170
* eliminate wasteful AS::SafeBuffer allocationAaron Patterson2014-06-061-1/+1
|
* fix formatting and text for ActionController::Redirecting docLaurel Fan2014-05-211-4/+8
|
* Fix syntax error in redirect_to examplePhilipe Fatio2013-12-141-1/+1
| | | | | Without parenthesis, ruby assumes that curly braces denote the beginning of a block.
* Fix regex used to find URI schemes in redirect_toDerek Prior2013-09-191-1/+1
| | | | | The previous regex was allowing `_` in the URI scheme, which is not allowed by RFC 3986. This change brings the regex in line with the RFC.
* Fix incorrect assert_redirected_to failure messageDerek Prior2013-09-191-19/+20
| | | | | | | | | | | | | | | In some instances, `assert_redirected_to` assertion was returning an incorrect and misleading failure message when the assertion failed. This was due to a disconnect in how the assertion computes the redirect string for the failure message and how `redirect_to` computes the string that is actually used for redirection. I made the `_compute_redirect_to_loaction` method used by `redirect_to` public and call that from the method `assert_redirect_to` uses to calculate the URL. The reveals a new test failure due to the regex used by `_compute_redirect_to_location` allow `_` in the URL scheme.
* Use \A in RegexpsEgor Homakov2013-02-011-1/+1
| | | | | So, if there is redirect_to params[:q] i can send ?q=javascript:asdf()%0A/localpath Or something more nasty, so please use \A
* Revert "log at debug level what line caused the redirect_to"Carlos Antonio da Silva2013-01-151-1/+0
| | | | | | | | This reverts commit 3fa00070047b5d019d39e691598ee2890283d052. Reason: This message is usually not accurate and annoying: Redirected by ~/.rbenv/versions/1.9.3-p327-perf/lib/ruby/1.9.1/logger.rb:371:in `add'`
* HTTP 302 means Found, not MovedChase DuBois2013-01-051-1/+1
|
* Refactor helpers code in Action Pack a bitCarlos Antonio da Silva2012-12-131-2/+1
| | | | | | | | * Avoid calling class_eval when not needed * Remove helpers_path attr accessor, it's defined as a class attribute a few lines later * Avoid creating extra arrays when finding helpers, use flat_map and sort! * Remove not required refer variable when redirecting :back
* Remove not used variable warnings from AM and ACCarlos Antonio da Silva2012-12-111-1/+1
|
* Multiple changes to 1,9 hash syntaxAvnerCohen2012-10-271-11/+11
|
* Merge pull request #2237 from jackdempsey/log_redirect_toAaron Patterson2012-05-161-0/+1
|\ | | | | log at debug level what line caused the redirect_to
| * log at debug level what line caused the redirect_toJack Dempsey2012-05-161-0/+1
| |
* | Removing ==Examples and last blank lines of docs from actionpackFrancesco Rodriguez2012-05-151-4/+0
| |
* | Add note about using 303 See Other for XHR requests other than GET/POSTAndrew White2012-04-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IE since version 6 and recently Chrome and Firefox have started following 302 redirects from XHR requests other than GET/POST using the original request method. This can lead to DELETE requests being redirected amongst other things. Although it doesn't directly affect the Rails framework since it doesn't return a 302 redirect to any non-GET/POST request a note has been added to raise awareness of the issue. Some references: Original article from @technoweenie: http://techno-weenie.net/2011/8/19/ie9-deletes-stuff/ Hacker News discussion of the article: http://news.ycombinator.com/item?id=2903493 WebKit bug report: https://bugs.webkit.org/show_bug.cgi?id=46183 Firefox bug report and changeset: https://bugzilla.mozilla.org/show_bug.cgi?id=598304 https://hg.mozilla.org/mozilla-central/rev/9525d7e2d20d Chrome bug report: http://code.google.com/p/chromium/issues/detail?id=56373 HTTPbis bug report and changeset: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/160 http://trac.tools.ietf.org/wg/httpbis/trac/changeset/1428 Roy T. Fielding's history of the issue: http://ftp.ics.uci.edu/pub/ietf/http/hypermail/1997q3/0611.html Automated browser tests for the issue: http://www.mnot.net/javascript/xmlhttprequest/ Fixes #4144
* | Updated/changed useless tr/gsubsJurriaan Pruis2012-04-031-1/+1
| |
* | strip null bytes from Location header as wellBrian Lopez2012-03-151-1/+1
| | | | | | | | add tests for stripping \r\n chars since that's already happening
* | Minor enhancement by not unnecessarely escaping forward slashing within a ↵Overbryd2011-12-051-1/+2
| | | | | | | | curly regexp and by mentoining the protocol relative scheme in the internal comment
* | Fix for redirect_to to respect urls with a network path reference like ↵Overbryd2011-12-051-2/+2
| | | | | | | | "//asset.host.com/resources/1235" see issue #3856
* | add namespacing when referring to ActionController::RedirectBackErrorNick Howard2011-10-251-2/+2
| |
* | if ... nil? is more expensive than unlessMilan Dobrota2011-09-041-1/+1
| |
* | ActionController::Redirecting : fix docs typodharmatech2011-08-201-1/+1
|/
* Tweak linebreak in ActionController::Redirecting docChristine Yen2011-06-151-2/+2
|
* Improve documentation around status code argument of redirect_toChristine Yen2011-06-151-1/+2
|
* There is no need to use instance_eval since the proc is created in the same ↵José Valim2010-09-241-1/+1
| | | | context it is eval'ed.
* Make redirect_to accept blocks [#5643 state:resolved]Nando Vieira2010-09-241-1/+5
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Adding linkage to redirect_to from Base and adding status code option referenceMikel Lindsaar2010-09-091-2/+4
|
* Revert "Setup explicit requires for files with exceptions. Removed them from ↵José Valim2010-09-021-2/+0
| | | | | | | | autoloading." Booting a new Rails application does not work after this commit [#5359 state:open] This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
* Setup explicit requires for files with exceptions. Removed them from ↵Łukasz Strzałkowski2010-09-021-0/+2
| | | | | | autoloading. Signed-off-by: José Valim <jose.valim@gmail.com>