Skip to content

Commit

Permalink
Merge pull request #492 from naoh87/fix_send_headers
Browse files Browse the repository at this point in the history
fix server don't sends header that client has sent
  • Loading branch information
ahjohannessen authored Jan 30, 2022
2 parents 1cd879e + 9cbc168 commit 20056a5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Fs2ServerCallHandler[F[_]: Async] private (
): ServerCallHandler[Request, Response] = new ServerCallHandler[Request, Response] {
def startCall(call: ServerCall[Request, Response], headers: Metadata): ServerCall.Listener[Request] = {
val listener = dispatcher.unsafeRunSync(Fs2UnaryServerCallListener[F](call, dispatcher, options))
listener.unsafeUnaryResponse(headers, _ flatMap { request => implementation(request, headers) })
listener.unsafeUnaryResponse(new Metadata(), _ flatMap { request => implementation(request, headers) })
listener
}
}
Expand All @@ -61,7 +61,7 @@ class Fs2ServerCallHandler[F[_]: Async] private (
): ServerCallHandler[Request, Response] = new ServerCallHandler[Request, Response] {
def startCall(call: ServerCall[Request, Response], headers: Metadata): ServerCall.Listener[Request] = {
val listener = dispatcher.unsafeRunSync(Fs2StreamServerCallListener[F](call, dispatcher, options))
listener.unsafeUnaryResponse(headers, implementation(_, headers))
listener.unsafeUnaryResponse(new Metadata(), implementation(_, headers))
listener
}
}
Expand All @@ -71,7 +71,7 @@ class Fs2ServerCallHandler[F[_]: Async] private (
): ServerCallHandler[Request, Response] = new ServerCallHandler[Request, Response] {
def startCall(call: ServerCall[Request, Response], headers: Metadata): ServerCall.Listener[Request] = {
val listener = dispatcher.unsafeRunSync(Fs2StreamServerCallListener[F](call, dispatcher, options))
listener.unsafeStreamResponse(headers, implementation(_, headers))
listener.unsafeStreamResponse(new Metadata(), implementation(_, headers))
listener
}
}
Expand Down

0 comments on commit 20056a5

Please sign in to comment.