From b314670530ee040d02c706824faf8b3a1925a2ef Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Tue, 26 Feb 2013 23:00:17 +0100 Subject: [PATCH] debug output --- lib/travis/web/app/alt_versions.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/travis/web/app/alt_versions.rb b/lib/travis/web/app/alt_versions.rb index 119d14fb..5cb934b8 100644 --- a/lib/travis/web/app/alt_versions.rb +++ b/lib/travis/web/app/alt_versions.rb @@ -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