Class: Jerk::Redirect

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/jerk.rb

Overview

DEFAULT Jerk::Redirect — issue a 301 redirect to the downcased version

Instance Method Summary collapse

Methods included from Base

#downcased_url, #each, #initialize, #url_without_query_string

Instance Method Details

#call(env) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/jerk.rb', line 36

def call(env)
  if url_without_query_string(env)[/[A-Z]/]
    [301, { Location: downcased_url(env) }, self]
  else
    super
  end
end