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

WIP: fix Content-Length & Content-Encoding if http response is decompresse… #3374

Conversation

kekaifun
Copy link

@kekaifun kekaifun commented Oct 9, 2023

…d by k6

fix #3373

What?

  • k6 will decompress http response body if content-encoding is supported, but Content-Length & Content-Encoding is not changed.
  • if http resonse header content-encoding has multivalues (aka: response body is compressed with multi different algorithms), if there is a content-encoding we don't support. k6 just skip the not support part and continue to decompress. that will lead errors

Why?

  • if response body is decompressed, we should set the content-length & content-header right accordingly
  • we need to stop decompress if there is a content-encoding not support instead of skip it and continue to decompress which lead to errors. So users may decompress the response body by themself.

Checklist

  • [x ] I have performed a self-review of my code.
  • I have added tests for my changes.
  • [ x] I have run linter locally (make ci-like-lint) and all checks pass.
  • [ x] I have run tests locally (make tests) and all tests pass.
  • [ x] I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

#3373

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2023

CLA assistant check
All committers have signed the CLA.

@kekaifun kekaifun force-pushed the fix/http-response-header-when-decompressed branch from 7cc16ed to fd42eff Compare October 9, 2023 03:28
@kekaifun kekaifun force-pushed the fix/http-response-header-when-decompressed branch from fd42eff to 022acb0 Compare October 9, 2023 03:28
@oleiade oleiade self-requested a review October 9, 2023 08:50
@oleiade
Copy link
Member

oleiade commented Oct 12, 2023

Thanks a lot for your contribution @kekaifun, much appreciated 🙇🏻

As detailled in #3374 we will, however, not be moving forward with merging this, as this would be a breaking change. We will however keep it in mind as we work towards shipping a new HTTP module 🤝

@oleiade oleiade closed this Oct 12, 2023
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.

Content-Length & Content-Encoding header is not changed accordingly when http response body is decompressed
3 participants