Permalink
Browse files

response might not be a faraday response

  • Loading branch information...
1 parent 7626ef4 commit d3410c9568258238e3852d2acdbd8e0fed8a92cb @rkh rkh committed Jun 7, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/gh/remote.rb
View
@@ -67,7 +67,9 @@ def fetch_resource(key)
# Internal: ...
def generate_response(key, response)
- body, headers, url = response.body, response.headers, response.env[:url]
+ body, headers = response.body, response.headers
+ url = response.respond_to?(:url) ? response.url : response.env.try(:[], :url)
+ url = full_url(key) if url.to_s.empty?
modify(body, headers, url)
end

0 comments on commit d3410c9

Please sign in to comment.