Method: ActionController::Redirecting._compute_redirect_to_location
- Defined in:
- lib/action_controller/metal/redirecting.rb
._compute_redirect_to_location(request, options) ⇒ Object
:nodoc:
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/action_controller/metal/redirecting.rb', line 206 def _compute_redirect_to_location(request, ) # :nodoc: case # The scheme name consist of a letter followed by any combination of letters, # digits, and the plus ("+"), period ("."), or hyphen ("-") characters; and is # terminated by a colon (":"). See # https://tools.ietf.org/html/rfc3986#section-3.1 The protocol relative scheme # starts with a double slash "//". when /\A([a-z][a-z\d\-+.]*:|\/\/).*/i .to_str when String if !.start_with?("/", "?") && !.empty? _handle_path_relative_redirect() end request.protocol + request.host_with_port + when Proc _compute_redirect_to_location request, instance_eval(&) else url_for() end.delete("\0\r\n") end |