debug output
This commit is contained in:
parent
c5aaa8806a
commit
b314670530
|
@ -9,12 +9,18 @@ class Travis::Web::App::AltVersions
|
|||
alt = alt_from_params(env) || alt_from_cookie(env)
|
||||
env['travis.alt'] = alt if alt
|
||||
status, headers, body = app.call(env)
|
||||
headers['Set-Cookie'] = "alt=#{alt}; Path=/; Secure" if alt
|
||||
set_cookie(headers, alt) if alt
|
||||
[status, headers, body]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_cookie(headers, alt)
|
||||
cookie = "alt=#{alt}; Path=/; Secure"
|
||||
puts "setting cookie #{cookie}"
|
||||
headers['Set-Cookie'] = cookie
|
||||
end
|
||||
|
||||
def alt_from_params(env)
|
||||
alt_from_string env['QUERY_STRING']
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user