Skip to content
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

Add support for HTTP compression using gzip #14

Merged
merged 8 commits into from
Apr 27, 2020
Merged

Conversation

rpkyle
Copy link
Contributor

@rpkyle rpkyle commented Apr 25, 2020

This pull request proposes to add support for compressing the body of HTTP responses using gzip when compress=true and the request's Accept-Encoding header includes gzip. In addition, some minor refactoring is suggested to improve 🌴.

To do:

  • Add tests for checking headers and disabling/enabling compression when compress is set on app creation.

Closes #17.

@rpkyle
Copy link
Contributor Author

rpkyle commented Apr 27, 2020

@waralex 🚨:tada: I've added a suite of unit tests as we discussed.

@rpkyle rpkyle linked an issue Apr 27, 2020 that may be closed by this pull request
@@ -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
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 08bb621

@rpkyle rpkyle added this to In progress in Dash for Julia Apr 27, 2020
Copy link
Collaborator

@waralex waralex left a 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 💃

@waralex waralex merged commit cd5c520 into dev Apr 27, 2020
Dash for Julia automation moved this from In progress to Done Apr 27, 2020
@rpkyle rpkyle deleted the 14-add-compression branch April 27, 2020 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests
Projects
Development

Successfully merging this pull request may close these issues.

Add support for HTTP compression in Dash.jl
2 participants