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

Streaming response body content type #2967

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

eyalfa
Copy link
Contributor

@eyalfa eyalfa commented Jul 14, 2024

streaming responses doesn't properly populate the media-type and boundary for the response's body.
This is especially an issue for MultipartMixed as it relies on the boundary in order to be able to parse the response stream into parts.

this PR introduces a test and a fix, the test initially fails with:

  Exception in thread "zio-fiber-71" java.lang.IllegalStateException: Cannot decode body as multipart/mixed without a known boundary
  	at zio.http.Body.$anonfun$asMultipartMixed$2(Body.scala:126)
  	at zio.ZIO$.$anonfun$fail$1(ZIO.scala:3164)
  	at zio.ZIO$.$anonfun$failCause$3(ZIO.scala:3173)
  	at zio.http.netty.NettyStreamBodySpec.spec(NettyStreamBodySpec.scala:153)
  	at zio.http.netty.NettyStreamBodySpec.spec(NettyStreamBodySpec.scala:104)```

applying the one-liner fix in `NettyResponse`, resolves the issue.

@eyalfa
Copy link
Contributor Author

eyalfa commented Jul 14, 2024

cc: @987Nabil

@987Nabil 987Nabil merged commit 25bd6ff into zio:main Jul 15, 2024
34 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.

None yet

2 participants