Skip to content

reject malformed content-length instead of crashing/hanging - #8

Merged
OneNobleSoul merged 1 commit into
mainfrom
fix/malformed-content-length
Jul 19, 2026
Merged

reject malformed content-length instead of crashing/hanging#8
OneNobleSoul merged 1 commit into
mainfrom
fix/malformed-content-length

Conversation

@OneNobleSoul

Copy link
Copy Markdown
Owner

a non-numeric Content-Length header raised an unhandled ValueError in do_POST (traceback, dropped connection). a negative one passed the max_body_bytes check and made rfile.read() block indefinitely, tying up a worker thread. both now get a clean 400 before rfile.read() is touched.

added tests for both cases.

a non-numeric Content-Length raised an unhandled ValueError, and a
negative one made rfile.read() block indefinitely tying up a worker
thread. now both get a clean 400.
@OneNobleSoul
OneNobleSoul merged commit f9f5fdb into main Jul 19, 2026
3 checks passed
@OneNobleSoul
OneNobleSoul deleted the fix/malformed-content-length branch July 19, 2026 04: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.

1 participant