diff options
| author | Samantaz Fox <coding@samantaz.fr> | 2021-07-29 02:15:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-28 17:15:51 -0700 |
| commit | 84594b0e1e841f7947737f778e66d156c79f22bc (patch) | |
| tree | 47be3a9f0d604ddbe5585818ce6252a6e79b821b /src | |
| parent | 578bbcd181e56c3b71837e96df8c2ae03ee491db (diff) | |
| download | invidious-84594b0e1e841f7947737f778e66d156c79f22bc.tar.gz invidious-84594b0e1e841f7947737f778e66d156c79f22bc.tar.bz2 invidious-84594b0e1e841f7947737f778e66d156c79f22bc.zip | |
Remove workaround for decompression of proxied files (#2286)
Was used by `proxy_file` before crystal 0.35.0.
Implemented in: f7dbf2bdd4f38fed72ad823be1bc86b727aafdb0
orphaned since: d30a972a909e66d963ee953349fe045a1d9a41ee
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/helpers/helpers.cr | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index d332ad37..fb7b19e6 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -710,34 +710,6 @@ class HTTP::Server::Response end end -class HTTP::Client::Response - def pipe(io) - HTTP.serialize_body(io, headers, @body, @body_io, @version) - end -end - -# Supports serialize_body without first writing headers -module HTTP - def self.serialize_body(io, headers, body, body_io, version) - if body - io << body - elsif body_io - content_length = content_length(headers) - if content_length - copied = IO.copy(body_io, io) - if copied != content_length - raise ArgumentError.new("Content-Length header is #{content_length} but body had #{copied} bytes") - end - elsif Client::Response.supports_chunked?(version) - headers["Transfer-Encoding"] = "chunked" - serialize_chunked_body(io, body_io) - else - io << body - end - end - end -end - class HTTP::Client property family : Socket::Family = Socket::Family::UNSPEC |
