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

Max streamed upload configuration value #184

Merged
merged 4 commits into from
Mar 23, 2023

Conversation

adam-fowler
Copy link
Member

maxUploadSize does not provide enough control over how much data should be uploaded. Routes that stream data require a much larger upload size limit as you are limiting how much data can be uploaded, while routes that collate the request body into one ByteBuffer require a smaller one as you are limiting how much memory you can hold in memory at any one time.

With this in mind this PR adds an additional maxStreamedUploadSize value to the application config. This value is probably the equivalent of the original maxUploadSize and is passed down to the server. The maxUploadSize is now used to limit the size of a ByteBuffer that can be collated from a stream.

@github-actions
Copy link

github-actions bot commented Mar 23, 2023

@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

Patch coverage: 50.61% and project coverage change: -0.29 ⚠️

Comparison is base (69189d3) 84.21% compared to head (b23efe3) 83.92%.

❗ Current head b23efe3 differs from pull request most recent head f09e67b. Consider uploading reports for the commit f09e67b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
- Coverage   84.21%   83.92%   -0.29%     
==========================================
  Files          77       77              
  Lines        4351     4517     +166     
==========================================
+ Hits         3664     3791     +127     
- Misses        687      726      +39     
Impacted Files Coverage Δ
...s/Hummingbird/AsyncAwaitSupport/Router+async.swift 57.44% <0.00%> (-3.92%) ⬇️
Sources/Hummingbird/Configuration.swift 45.94% <41.37%> (-26.89%) ⬇️
Sources/Hummingbird/Server/Request.swift 86.74% <81.81%> (-7.78%) ⬇️
Sources/Hummingbird/Router/RouterMethods.swift 94.95% <100.00%> (+0.26%) ⬆️

... and 3 files with indirect coverage changes

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

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adam-fowler adam-fowler merged commit 17b914c into main Mar 23, 2023
@adam-fowler adam-fowler deleted the feature/max-streamed-upload branch March 23, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant