Commit graph

3 commits

Author SHA1 Message Date
wjqserver
e6ff0fa6b9 fix(maxreader): treat non-positive limits as unlimited 2026-04-01 00:03:23 +08:00
wjqserver
91c50536c4 fix(maxreader): avoid hangs after reaching body limit 2026-03-31 23:37:02 +08:00
wjqserver
64e2ad9e7b Fix FileText status code and unify request body size limits
- FileText: now respects the provided status code instead of defaulting to 200 OK
- Request body limits: prepareRequestBody() is now only called when MaxRequestBodySize > 0
  - ShouldBindJSON, ShouldBindWANF, ShouldBindGOB, ShouldBindForm, GetReqBody, PostForm
    all now use the original c.Request.Body path when no limit is configured
- maxBytesReader: fixed exact-limit boundary case where body size == limit was
  incorrectly rejected
- Added regression tests for FileText status codes and body limit behavior

All existing tests pass, and new tests verify the corrected behavior.
2026-03-31 16:38:04 +08:00