mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix proxy_file when response body is empty
This commit is contained in:
parent
f237fd9847
commit
3ac8de0a64
1 changed files with 4 additions and 0 deletions
|
@ -631,6 +631,10 @@ def cache_annotation(db, id, annotations)
|
||||||
end
|
end
|
||||||
|
|
||||||
def proxy_file(response, env)
|
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")
|
if response.headers.includes_word?("Content-Encoding", "gzip")
|
||||||
Gzip::Writer.open(env.response) do |deflate|
|
Gzip::Writer.open(env.response) do |deflate|
|
||||||
IO.copy(response.body_io, deflate)
|
IO.copy(response.body_io, deflate)
|
||||||
|
|
Loading…
Reference in a new issue