lib/schmobile/middleware.rb in schmobile-1.0.0 vs lib/schmobile/middleware.rb in schmobile-2.0.0
- old
+ new
@@ -8,11 +8,11 @@
def call(env)
request = Rack::Request.new(env)
if request.is_mobile? && redirect?(request)
- [ 301, { "Location" => redirect_location(request) }, [] ]
+ [ 301, { 'Location' => redirect_location(request) }, [] ]
else
@app.call(env)
end
end
@@ -29,10 +29,10 @@
redirecting &&= request.path !~ /^#{@options[:redirect_to]}/
else
redirecting = false
end
- redirecting ? redirect_location(request) : nil
+ redirecting
end
def redirect_location(request)
"#{@options[:redirect_to]}#{redirect_with(request)}"
end