Skip to content

Web: CONTENT_LENGTH for incoming POST (fixes #314)#319

Merged
PurHur merged 1 commit into
masterfrom
feat/web-content-length-314
May 19, 2026
Merged

Web: CONTENT_LENGTH for incoming POST (fixes #314)#319
PurHur merged 1 commit into
masterfrom
feat/web-content-length-314

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 19, 2026

Summary

  • Populate $_SERVER['CONTENT_LENGTH'] and CGI env from the HTTP Content-Length header using the number of body bytes actually read (not chunked requests without that header; see Web: DevServer POST bodies without Content-Length (chunked transfer-encoding) #287).
  • Outgoing responses already emit Content-Length in DevServer::respond(); this PR focuses on the incoming CGI path for VM serve and AOT serve-aot.
  • Add unit tests, VM/AOT PHPT fixtures, and ServeTest / ServeAotTest POST integration tests.

Test plan

  • vendor/bin/phpunit --exclude-group serve,llvm --filter ContentLength (unit + header mapping)
  • ./script/docker-ci-local.sh --filter ContentLength (unit slice; serve group needs loopback)
  • Full ./script/docker-ci-local.sh on a host with working serve integration

Closes #314

Made with Cursor

Sync CGI CONTENT_LENGTH from the bytes read when the client sends
Content-Length; add unit, PHPT, and serve integration coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit a79e83e into master May 19, 2026
1 check failed
@PurHur PurHur deleted the feat/web-content-length-314 branch May 19, 2026 18:41
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.

Web: CONTENT_LENGTH — incoming $_SERVER and outgoing CGI Content-Length

1 participant