timw commented on issue #461:
URL: https://github.com/apache/pekko-http/issues/461#issuecomment-5404011796

   A related API coherency issue is the treatment of HTTP/2 messages.
   
   In the server API, `HttpEntity.Strict` and `HttpEntity.Chunked` can be used 
to construct HTTP/2 responses (optionally with trailers), but only 
`HttpEntity.Chunked` is produced by the client.
   Given the ability to test routes with in-memory `HttpResponse` objects and 
routes, client code often needs to handle the `HttpEntity.Strict` + trailers 
attribute variant as well, even if it's never encountered in a real-world 
scenario.
   
   `HttpEntity.Strict` is a major performance improvement for server apps doing 
small unary responses, and it'd actually be nice to support it in the client to 
that end.
   
   Also related, the intermingling of trailers into the entity encoding and 
request attributes makes this even more awkward to handle for clients (like 
pekko-grpc) that need to be aware of trailers. There's a bunch of code out 
there concatenating response headers and the trailers obtained from 2 different 
possible locations to search for headers, which seems inelegant.
   If trailers were the materialized value for the `HttpEntity.dataBytes` 
stream, it might be allow more consistent access, but still a bit weird having 
it exposed in the entity.


-- 
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