Skip to content

Conversation

@arun0009
Copy link
Contributor

@arun0009 arun0009 commented Nov 20, 2020

Adding decompress middleware that decompresses request if content-encoding is set to "gzip". We send in large amounts of data and we want to compress data on the network and decompress it in API. This is trivial for any API that ingests a large amount of payload. Also addresses one of the issues logged on echo #986.

Added tests as well to cover most of the scenarios. Can you please review @lammel

P.S Build was failing as github actions deprecated passing env variables, updated workflows/echo.yaml to fix this issue. More details here https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

@codecov
Copy link

codecov bot commented Nov 20, 2020

Codecov Report

Merging #1687 (b47042f) into master (7a90304) will increase coverage by 0.10%.
The diff coverage is 94.73%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #1687 +/- ## ========================================== + Coverage 84.35% 84.45% +0.10%  ========================================== Files 28 29 +1 Lines 1911 1930 +19 ========================================== + Hits 1612 1630 +18  - Misses 189 190 +1  Partials 110 110 
Impacted Files Coverage Δ
middleware/decompress.go 94.73% <94.73%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a90304...b47042f. Read the comment docs.

@lammel
Copy link
Contributor

lammel commented Nov 20, 2020

Looking good!

Would you mind adding a PR for this middleware with an example for the documentation in echox project?
That would definitely be helpful for all those backend REST API wrestlers our there having to transfer bigger payloads.

As the PR is already cleanup up, tests added and no breaking changes, will merge.

Thanks @arun0009 !

@lammel lammel merged commit ce95e12 into labstack:master Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants