mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
don't parse head requests that are errors
This commit is contained in:
parent
f864db9d9e
commit
235438aca4
1 changed files with 19 additions and 19 deletions
|
@ -73,6 +73,7 @@ unless Fog.mocking?
|
|||
response.headers[capitalize(header[0])] = header[1]
|
||||
end
|
||||
|
||||
unless params[:method] == 'HEAD'
|
||||
if error || params[:parser]
|
||||
if error
|
||||
parser = Fog::Errors::Parser.new
|
||||
|
@ -86,7 +87,6 @@ unless Fog.mocking?
|
|||
body = ''
|
||||
end
|
||||
|
||||
unless params[:method] == 'HEAD'
|
||||
if response.headers['Content-Length']
|
||||
if error || !params[:block]
|
||||
body << @connection.read(response.headers['Content-Length'].to_i)
|
||||
|
@ -112,7 +112,6 @@ unless Fog.mocking?
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if parser
|
||||
body.finish
|
||||
|
@ -120,6 +119,7 @@ unless Fog.mocking?
|
|||
else
|
||||
response.body = body
|
||||
end
|
||||
end
|
||||
|
||||
if error
|
||||
raise(Fog::Errors.status_error(params[:expects], response.status, response))
|
||||
|
|
Loading…
Add table
Reference in a new issue