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

Content-Length, chunked transfer encoding and Host header improvements #2563

Merged
merged 5 commits into from
Jan 6, 2024

Conversation

vigoo
Copy link
Contributor

@vigoo vigoo commented Dec 22, 2023

Some fixes and improvements based on recent Discord discussions:

  • If there is already a Host header set, it is not going to be overwritten based on the request url
  • Content length information is now attached to the various Body types. If the content length is set, we will not use chunked transfer encoding, regardless of the body is streaming or not.
  • Some Body and Handler constructors are duplicated now having a variant that gets a known content length, and one that does not (using the post-fix Chunked for them)

@github-actions github-actions bot added the docs label Dec 22, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2023

Codecov Report

Attention: 29 lines in your changes are missing coverage. Please review.

Comparison is base (c846a86) 64.47% compared to head (a694478) 64.37%.

Files Patch % Lines
...rc/main/scala/zio/http/netty/NettyBodyWriter.scala 41.66% 14 Missing ⚠️
zio-http/src/main/scala/zio/http/Body.scala 60.00% 4 Missing ⚠️
zio-http/src/main/scala/zio/http/Handler.scala 0.00% 4 Missing ⚠️
...main/scala/zio/http/codec/internal/BodyCodec.scala 0.00% 2 Missing ⚠️
...scala/zio/http/codec/internal/EncoderDecoder.scala 33.33% 2 Missing ⚠️
...http/src/main/scala/zio/http/netty/NettyBody.scala 60.00% 2 Missing ⚠️
zio-http/src/main/scala/zio/http/Response.scala 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2563      +/-   ##
==========================================
- Coverage   64.47%   64.37%   -0.11%     
==========================================
  Files         140      140              
  Lines        8302     8333      +31     
  Branches     1496     1503       +7     
==========================================
+ Hits         5353     5364      +11     
- Misses       2949     2969      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vigoo vigoo merged commit 4d30f47 into main Jan 6, 2024
25 checks passed
@vigoo vigoo deleted the content-length-improvements branch January 6, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants