raboof commented on code in PR #471:
URL: https://github.com/apache/pekko-grpc/pull/471#discussion_r2164087720


##########
runtime/src/main/scala/org/apache/pekko/grpc/internal/GrpcResponseHelpers.scala:
##########
@@ -111,6 +111,6 @@ object GrpcResponseHelpers {
         headers.`Message-Encoding`(writer.messageEncoding.name) ::
         GrpcEntityHelpers.trailers(trailer.status, trailer.metadata),
       entity = HttpEntity.empty(writer.contentType)
-    )
+    ).withAttributes(Map(AttributeKeys.trailer -> trailer))

Review Comment:
   > Wait is that because I manually add them to the headers myself and if a 
trailer attribute gets detected it will also get added somewhere further in the 
pipeline?
   
   Exactly: the headers go into the headers fragment of the response, and the 
trailer attribute goes into the trailing headers fragment of the response.
   
   > Wouldn't it be preferable to then only add it to the attributes and rely 
on it getting added later on?
   
   that would still split it over a headers fragment and a trailing headers 
block. I think it's ok to send a single headers fragment in this case, even if 
it means putting the 'trailer' data into regular headers - this is basically 
the `Trailers-Only` scenario.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to