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

[bugfix] Return raw ZIO response body where applicable #3047

Merged
merged 3 commits into from
Jul 20, 2023

Conversation

kciesielski
Copy link
Member

@kciesielski kciesielski commented Jul 19, 2023

Fixes #3034

This PR changes handling of raw body types. Instead of always using a ZStream, such responses are packed into a Chunk[Byte]. This allows logging the response body by zio.http.internal.middlewares.RequestLogging.

@kciesielski kciesielski force-pushed the bugfix/3034-zio-http-raw-body branch from d76d77f to 3c0a109 Compare July 19, 2023 15:07
@kciesielski kciesielski linked an issue Jul 19, 2023 that may be closed by this pull request
@kciesielski kciesielski marked this pull request as ready for review July 19, 2023 15:43
@kciesielski kciesielski requested a review from adamw July 19, 2023 15:43
def contentLength: Option[Long]
}

private[ziohttp] case class ZioStreamHttpResponseBody(stream: ZStream[Any, Throwable, Byte], val contentLength: Option[Long])
Copy link
Member

Choose a reason for hiding this comment

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

[minor] is the val needed? it is a case class?

Copy link
Member

@adamw adamw left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! :)

@kciesielski kciesielski merged commit 9c3ad53 into master Jul 20, 2023
@mergify mergify bot deleted the bugfix/3034-zio-http-raw-body branch July 20, 2023 10:01
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.

[BUG] tapir + zio-http is not logging response
2 participants