Support Crystal 0.35.0

This commit is contained in:
Omar Roth
2020-06-15 17:57:20 -05:00
parent 338dc3223c
commit d30a972a90
6 changed files with 48 additions and 22 deletions

View File

@@ -74,10 +74,10 @@ class FilteredCompressHandler < Kemal::Handler
if request_headers.includes_word?("Accept-Encoding", "gzip")
env.response.headers["Content-Encoding"] = "gzip"
env.response.output = Gzip::Writer.new(env.response.output, sync_close: true)
env.response.output = Compress::Gzip::Writer.new(env.response.output, sync_close: true)
elsif request_headers.includes_word?("Accept-Encoding", "deflate")
env.response.headers["Content-Encoding"] = "deflate"
env.response.output = Flate::Writer.new(env.response.output, sync_close: true)
env.response.output = Compress::Deflate::Writer.new(env.response.output, sync_close: true)
end
call_next env