Add gzip helper to enable/disable HTTP::DeflateHandler

This commit is contained in:
sdogruyol 2016-09-15 19:35:34 +03:00
parent 7c8915bfa4
commit 4cd30839a5
3 changed files with 21 additions and 4 deletions

View file

@ -122,4 +122,15 @@ describe "Macros" do
response.headers["Content-Length"].should eq("6")
end
end
describe "#gzip" do
it "adds HTTP::DeflateHandler to handlers" do
gzip true
Kemal.config.handlers.last.is_a?(HTTP::DeflateHandler).should eq true
end
it "doesn't add HTTP::DeflateHandler to handlers by default" do
Kemal.config.handlers.last.is_a?(HTTP::DeflateHandler).should eq false
end
end
end