pjfanning commented on code in PR #833:
URL: https://github.com/apache/pekko-http/pull/833#discussion_r2420136958


##########
http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/hpack/HeaderDecompression.scala:
##########
@@ -92,9 +92,8 @@ private[http2] final class 
HeaderDecompression(masterHeaderParser: HttpHeaderPar
             }
           }
         }
-        val bis = ByteStringInputStream(payload)
         try {
-          decoder.decode(bis, Receiver)
+          decoder.decode(payload.compact.asInputStream, Receiver) // only 
compact ByteString supports InputStream with mark/reset

Review Comment:
   I'm not against this generally. One edge case is a ByteString that has a 
backing array but a non-zero offset.
   We can get a safe InputStream directly from those ByteStreams without 
compacting them (an InputStream that supports mark/reset). I think in practice 
such ByteStrings are rare. So if we agree that such ByteStrings are not 
worrying about then I'm happy enough to go with this change. 



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