Skip to content

fix: reject a data_base64 attribute in binary mode - #77

Open
EmiRZx wants to merge 1 commit into
cloudevents:mainfrom
EmiRZx:fix-binary-data-base64-header
Open

EmiRZx wants to merge 1 commit into
cloudevents:mainfrom
EmiRZx:fix-binary-data-base64-header

Conversation

@EmiRZx

@EmiRZx EmiRZx commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

fixes #76. deserializeBinary() now throws InvalidAttributeException when the attributes contain data_base64. a header like ce-foo_bar already gets the same exception. structured and batch mode are unchanged. the new test fails on main and passes here. tests pass on PHP 8.1, 8.4 and 8.5. phpcs and psalm are clean. it merges cleanly with #68, #72 and #75.

In binary mode the data is the HTTP body. A ce-data_base64 header
still reached the denormalizer as an attribute and DataFormatter used
it in place of the body. So the app got different data from the body.
Other ce- headers that aren't valid attribute names, like ce-foo_bar,
are already rejected with InvalidAttributeException. data_base64 is
now rejected the same way.

Signed-off-by: emir <52245396+EmiRZx@users.noreply.github.com>
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.

A ce-data_base64 header replaces the body in binary mode

1 participant