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
{{ message }}
Repository navigation
Commit bd827d5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-storage, plugin-hono-server): the upload link's several-file form is bounded by its own limit, not the request-body limit
A route refused req.body for size that then reads rawBody() takes the read
over under its own bound. The upload-link door reads its several-file form
that way when the transport refuses it, judges the bytes against its own form
limit, and parses the form itself.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibyNMYdfN5kzwSS28Rs
Copy file name to clipboardExpand all lines: .changeset/request-body-limit.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
'@objectstack/plugin-hono-server': patch
3
3
'@objectstack/hono': patch
4
+
'@objectstack/service-storage': patch
4
5
---
5
6
6
7
fix(plugin-hono-server, hono): a request body over the server's limit is answered 413 PAYLOAD_TOO_LARGE and is not read past the limit
@@ -13,3 +14,5 @@ Both HTTP doors, the self-hosted server (`@objectstack/plugin-hono-server`) and
13
14
To change the limit, set `maxRequestBodyBytes` (in bytes) on `HonoServerPlugin`, call `HonoHttpServer.setMaxRequestBodyBytes()` on an embedded adapter, or pass `maxRequestBodyBytes` to `createHonoApp`. Without an option, the `OS_HTTP_MAX_BODY_BYTES` environment variable sets it. A value that is not a positive whole number of bytes fails the boot instead of serving with no limit or the wrong one.
14
15
15
16
Upload doors keep their own limit. The storage byte doors (the presigned raw PUT, the chunk PUT and the upload-link PUT) read the raw bytes through `IHttpRequest.rawBody()`, which still serves the whole body, so a file is bounded by the storage `max_upload_mb` setting exactly as before, even when that is larger than the request-body limit.
17
+
18
+
The upload link's several-file form is bounded by that door's own form limit (each file within `max_upload_mb`, times the files the link takes, plus the form's framing), not by the request-body limit. A route that is refused `req.body` for size and then reads `rawBody()` takes the read over under its own bound, and its own answer stands.
0 commit comments