Skip to content

Transport request bodies as base64 postDataBuffer#116

Merged
smnandre merged 1 commit into
playwright-php:mainfrom
smnandre:sa/post-data-buffer
Jul 21, 2026
Merged

Transport request bodies as base64 postDataBuffer#116
smnandre merged 1 commit into
playwright-php:mainfrom
smnandre:sa/post-data-buffer

Conversation

@smnandre

Copy link
Copy Markdown
Member

extractRequestData never shipped postDataBuffer, so RequestInterface::postDataBuffer() always returned null. Worse, postData() corrupts non-UTF8 bytes on their way through the JSON transport, so intercepted binary POST bodies (file uploads, some multipart payloads) arrive mangled with no way to recover them.

The server now sends the raw body base64-encoded in a postDataBuffer field and Request::postDataBuffer() decodes it. Functional tests intercept a binary and a text POST and assert byte-for-byte equality.

extractRequestData never shipped postDataBuffer, so RequestInterface::postDataBuffer() always returned null, and postData() corrupts non-UTF8 bytes in the JSON transport. The server now sends the raw body base64-encoded and Request::postDataBuffer() decodes it. Functional tests intercept a binary POST and assert byte-for-byte equality.
@smnandre
smnandre force-pushed the sa/post-data-buffer branch from 357e8f8 to ef8a873 Compare July 21, 2026 17:33
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@smnandre
smnandre merged commit fece8b5 into playwright-php:main Jul 21, 2026
11 checks passed
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