Skip to content

Commit

Permalink
Better message for redirects.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Aug 25, 2019
1 parent 53ae5a6 commit f99eeb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/http.rb
Expand Up @@ -123,7 +123,11 @@ def data

def message
msg = if @obj.is_a?(HTTPResponse)
"#{@obj.code}: #{@obj.body}"
if @obj.redirect?
"#{@obj.code}: #{@obj.headers["location"].join(", ")}"
else
"#{@obj.code}: #{@obj.body}"
end
else
@obj.inspect
end
Expand Down

0 comments on commit f99eeb9

Please sign in to comment.