Disable inflate gzip on head method (#7432)

main
Yamagishi Kazutoshi 2018-05-10 21:36:12 +09:00 committed by Eugen Rochko
parent ac788ad47e
commit 6588f6a0a9
1 changed files with 6 additions and 5 deletions

View File

@ -51,16 +51,17 @@ class Request
end end
def headers def headers
(@account ? @headers.merge('Signature' => signature) : @headers).reverse_merge('Accept-Encoding' => 'gzip').without(REQUEST_TARGET) (@account ? @headers.merge('Signature' => signature) : @headers).without(REQUEST_TARGET)
end end
private private
def set_common_headers! def set_common_headers!
@headers[REQUEST_TARGET] = "#{@verb} #{@url.path}" @headers[REQUEST_TARGET] = "#{@verb} #{@url.path}"
@headers['User-Agent'] = user_agent @headers['User-Agent'] = user_agent
@headers['Host'] = @url.host @headers['Host'] = @url.host
@headers['Date'] = Time.now.utc.httpdate @headers['Date'] = Time.now.utc.httpdate
@headers['Accept-Encoding'] = 'gzip' if @verb != :head
end end
def set_digest! def set_digest!