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.
This commit is contained in:
Akinori MUSHA 2016-11-04 14:58:12 +09:00
parent b8d88aa9a3
commit 833985d723

View file

@ -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?