Skip to content

Handle POST without Content-Length#126

Merged
hsbt merged 1 commit into
masterfrom
fix-post-without-content-length-issue-56
Jun 23, 2026
Merged

Handle POST without Content-Length#126
hsbt merged 1 commit into
masterfrom
fix-post-without-content-length-issue-56

Conversation

@hsbt

@hsbt hsbt commented Jun 23, 2026

Copy link
Copy Markdown
Member

A POST request with no Content-Length header, or with an empty value, made CGI.new raise TypeError or ArgumentError from Integer(nil) and Integer(""). This change treats a missing or empty length as unspecified.

For url-encoded forms the body is now read to EOF. For multipart the length is required, so it raises a clear error instead of crashing.

#56

A POST with no Content-Length header (or an empty value) made CGI.new
raise TypeError/ArgumentError from Integer(nil)/Integer(""). Treat a
missing or empty length as unspecified: read the body to EOF for
url-encoded forms, and raise a clear error for multipart where the
length is required.

#56

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hsbt hsbt merged commit 23f26a0 into master Jun 23, 2026
70 checks passed
@hsbt hsbt deleted the fix-post-without-content-length-issue-56 branch June 23, 2026 07:03
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