-
-
Notifications
You must be signed in to change notification settings - Fork 42
Add support for HTTP compression using gzip #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@waralex 🚨:tada: I've added a suite of unit tests as we discussed. |
9204492
to
ee7b556
Compare
@@ -107,7 +135,9 @@ function make_handler(app::DashApp; debug::Bool = false) | |||
end | |||
end | |||
end | |||
if @isdefined body | |||
return make_response(200, headers, body, with_gzip) | |||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpkyle I suggest not using isdefined
, instead it's better to define body:: Union{Nothing, String} = nothing
at the beginning of the function and change the check to isnothing(body)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 08bb621
14b5f20
to
08bb621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great. Thanks 💃
This pull request proposes to add support for compressing the body of HTTP responses using
gzip
whencompress=true
and the request'sAccept-Encoding
header includesgzip
. In addition, some minor refactoring is suggested to improve 🌴.To do:
compress
is set onapp
creation.Closes #17.