From 833985d723841d87fea21daca7feb3d4c0b2b8d3 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Fri, 4 Nov 2016 14:58:12 +0900 Subject: [PATCH] Fix a bug where `redirected` is always true This key was introduced in #1590 but it is likely that it has never worked as expected. --- app/models/agents/http_status_agent.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/agents/http_status_agent.rb b/app/models/agents/http_status_agent.rb index 42c1cc4f..251dfe26 100644 --- a/app/models/agents/http_status_agent.rb +++ b/app/models/agents/http_status_agent.rb @@ -84,7 +84,7 @@ module Agents # Deal with failures if measured_result.result - final_url = boolify(interpolated['disable_redirect_follow']) ? url : measured_result.result.to_hash[:url] + final_url = boolify(interpolated['disable_redirect_follow']) ? url : measured_result.result.env.url.to_s payload.merge!({ 'final_url' => final_url, 'redirected' => (url != final_url), 'response_received' => true, 'status' => current_status }) # Deal with headers if local_headers.present?