Fix proxy_file when response body is empty

このコミットが含まれているのは:
Omar Roth 2019-05-19 07:13:13 -05:00
コミット 3ac8de0a64
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: B8254FB7EC3D37F2
1個のファイルの変更4行の追加0行の削除

ファイルの表示

@ -631,6 +631,10 @@ def cache_annotation(db, id, annotations)
end
def proxy_file(response, env)
if response.headers["Content-Length"]? && response.headers["Content-Length"] == "0"
return
end
if response.headers.includes_word?("Content-Encoding", "gzip")
Gzip::Writer.open(env.response) do |deflate|
IO.copy(response.body_io, deflate)