zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

Multipart #1559

Open fokot opened this issue 1 year ago • 1 comments

I created this PR, just to have some input how to solve it. It is still WIP.

Is this a good approach to use netty's HttpPostMultipartRequestDecoder? If so I need to implement it also in for addAsyncBodyHandler. Should I rather use my own sealed trait instead of netty's InterfaceHttpData in the body? Thiss way when we change netty to something else the api will stay the same.

If this approach is not best I can do manual parsing on the stream as they did it in http4s but it is much more work. Plugging this in will be easier though as I could use just Body.asStream.

What do you think?

And I will delete the bigfile.txt.

fokot avatar Oct 09 '22 09:10 fokot

Codecov Report

Base: 60.97% // Head: 60.91% // Decreases project coverage by -0.06% :warning:

Coverage data is based on head (6e14711) compared to base (bba0258). Patch coverage: 14.28% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1617      +/-   ##
==========================================
- Coverage   60.97%   60.91%   -0.07%     
==========================================
  Files         129      131       +2     
  Lines        4431     4488      +57     
  Branches      139      163      +24     
==========================================
+ Hits         2702     2734      +32     
- Misses       1729     1754      +25     
Impacted Files Coverage Δ
...p/src/main/scala/zio/http/MultipartConverter.scala 0.00% <0.00%> (ø)
zio-http/src/main/scala/zio/http/Body.scala 74.07% <57.14%> (-4.65%) :arrow_down:
...a/zio/http/netty/server/ServerInboundHandler.scala 83.72% <100.00%> (ø)
...o-http/src/main/scala/zio/http/api/HttpCodec.scala 48.88% <0.00%> (-1.12%) :arrow_down:
...a/zio/http/model/headers/values/AcceptRanges.scala 100.00% <0.00%> (ø)
...ttp/src/main/scala/zio/http/api/HeaderCodecs.scala 97.91% <0.00%> (+0.02%) :arrow_up:
...in/scala/zio/http/api/internal/RichTextCodec.scala 73.33% <0.00%> (+23.33%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 09 '22 09:10 codecov-commenter