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

Added support for gzipped request body decoding #4

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

oylbin
Copy link
Contributor

@oylbin oylbin commented Sep 26, 2023

  • Added dependencies on flate2:1.0.26 in Cargo.toml, (1.0.27 breaks docker build).
  • Refactored request body reading in src/serve.rs to support both gzip-encoded and plain request bodies.

To test the new function, use the following shell command:

echo '{"mydummy": "json"}' | gzip | curl -v -i --data-binary @- -H "Content-Encoding: gzip" -H 'Content-Type: application/json' http://localhost:8000/test_endpoint

- Added dependencies on `flate2:1.0.26` in Cargo.toml, (1.0.27 breaks docker build).
- Refactored request body reading in `src/serve.rs` to support both gzip-encoded and plain request bodies.

To test the new function, use the following shell command:

```
echo '{"mydummy": "json"}' | gzip | curl -v -i --data-binary @- -H "Content-Encoding: gzip" -H 'Content-Type: application/json' http://localhost:8000/test_endpoint
```
Copy link
Owner

@atomic77 atomic77 left a comment

Choose a reason for hiding this comment

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

Thank you @oylbin for taking the time to contribute this feature back! It's been a while since i've looked at this repo but i'll make sure the asset releases and docker hub get updated, I'm not sure if they will work out of the box after all this time.

@atomic77 atomic77 merged commit 1791cc2 into atomic77:master Sep 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants