You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would propose the following optimizations in readBody and would like to know what you think about that @pi0
Instead of first calling response.text(), use the content-length header to determine if a body is existent (Transfer-Encoding: chunked and form data shouldn't be relevant here, as they have their own helpers)
Then check the content-type header and call parseURLEncodedBody on request.text() if applies
Otherwise directly return response.json() instead of passing text to JSON.parse as destr was removed anyway
This would avoid memory overhead for large files and could also enable file/request size limits, which are normally based on the content-length header (DOS protection). Although there might be better places for content-length validation.
Additional information
Would you be willing to help implement this feature?
The text was updated successfully, but these errors were encountered:
Describe the feature
I would propose the following optimizations in readBody and would like to know what you think about that @pi0
This would avoid memory overhead for large files and could also enable file/request size limits, which are normally based on the content-length header (DOS protection). Although there might be better places for content-length validation.
Additional information
The text was updated successfully, but these errors were encountered: