Skip to content

Commit

Permalink
Make sure status is an integer when set
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Nov 23, 2016
1 parent 40f884b commit 6ab6ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/agents/website_agent.rb
Expand Up @@ -130,7 +130,7 @@ class WebsiteAgent < Agent
* `_response_`: A response object with the following keys:
* `status`: HTTP status as integer. (Almost always 200) When parsing `data_from_event`, this is set to the value of the `status` key in the incoming Event.
* `status`: HTTP status as integer. (Almost always 200) When parsing `data_from_event`, this is set to the value of the `status` key in the incoming Event, if it is a number or a string convertible to an integer.
* `headers`: Response headers; for example, `{{ _response_.headers.Content-Type }}` expands to the value of the Content-Type header. Keys are insensitive to cases and -/_. When parsing `data_from_event`, this is constructed from the value of the `headers` key in the incoming Event, if it is a hash.
Expand Down Expand Up @@ -624,7 +624,7 @@ def headers

# Integer value of HTTP status
def status
@object.payload[:status]
Integer(@object.payload[:status]) rescue nil
end

# The URL
Expand Down

0 comments on commit 6ab6ea7

Please sign in to comment.