com-lihaoyi / cask

Cask: a Scala HTTP micro-framework. Cask makes it easy to set up a website, backend server, or REST API using Scala
https://com-lihaoyi.github.io/cask/
Other
527 stars 55 forks source link

Use ctx.bytes rather than getting the InputStream directly #73

Closed rmn36 closed 4 months ago

rmn36 commented 2 years ago

Use ctx.bytes rather than getting the InputStream directly so that the contents of the InputStream are cached in the Request object. Right now if a Decorator tries to access the request body via the InputStream the InputStream will then be empty for the postJson decorator. Therefore, postJson should use the bytes field of Request so if an upstream Decorator also accesses the bytes field the value will be cached.

rmn36 commented 1 year ago

@lihaoyi can you please review this? It's been open for awhile and is a very small change.

lihaoyi commented 4 months ago

Superseded by https://github.com/com-lihaoyi/cask/pull/123