Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling streaming upload with multipart-form data fails with payloads greater than ~7KB #2851

Closed
gcsolaroli opened this issue May 18, 2024 · 5 comments · Fixed by #2882
Closed
Labels
💎 Bounty bug Something isn't working 💰 Rewarded

Comments

@gcsolaroli
Copy link

Describe the bug
When a request with a form field of type 'file' is processed using a StreamingForm, payloads greater than ~7Kb fail.

To Reproduce
Steps to reproduce the behaviour:

  1. Clone sample project
  2. Run sbt test
  3. Two tests should fail:
    • POST largish blob 'data'
    • POST large blob 'data'

Expected behaviour
The code include two different implementation of the code handling the requests, named data and path (matching the two paths where the code is bound to).
The data implementation uses StreamingForm values all around, while path writes down the payload into a temporary file and then uses the content of this temporary file instead of using directly the request payload content.

Some more details are reported into the sample project README file.

Desktop:

  • OS: MacOS 14.4.1
  • JVM:

    $ java --version
    openjdk 21.0.2 2024-01-16
    OpenJDK Runtime Environment GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30)
    OpenJDK 64-Bit Server VM GraalVM CE 21.0.2+13.1 (build 21.0.2+13-jvmci-23.1-b30, mixed mode, sharing)

  • Scala: 3.4.2
@gcsolaroli gcsolaroli added the bug Something isn't working label May 18, 2024
@jdegoes
Copy link
Member

jdegoes commented Jun 4, 2024

/bounty $250

Copy link

algora-pbc bot commented Jun 4, 2024

💎 $250 bounty • ZIO

Steps to solve:

  1. Start working: Comment /attempt #2851 with your implementation plan
  2. Submit work: Create a pull request including /claim #2851 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Additional opportunities:

Thank you for contributing to zio/zio-http!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @teserk Jun 5, 2024, 5:49:02 AM WIP
🟢 @kyri-petrou #2882

@teserk
Copy link

teserk commented Jun 5, 2024

/attempt #2851

Copy link

algora-pbc bot commented Jun 5, 2024

💡 @kyri-petrou submitted a pull request that claims the bounty. You can visit your bounty board to reward.

Copy link

algora-pbc bot commented Jun 5, 2024

🎉🎈 @kyri-petrou has been awarded $250! 🎈🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💎 Bounty bug Something isn't working 💰 Rewarded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants