Skip to content

[5.x] Record plain/text request content #1578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 27, 2025
Merged

Conversation

cosmastech
Copy link
Contributor

@cosmastech cosmastech commented Mar 25, 2025

To close #1569

Requests were predicated on being a JSON body or form input. Now, if we receive a payload with content-type: text/plain, it will record the body.

Before:
image

After:
image

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@cosmastech cosmastech changed the title [5.x] Record plain/text content [5.x] Record plain/text request content Mar 25, 2025
@cosmastech cosmastech marked this pull request as ready for review March 25, 2025 15:04
@taylorotwell taylorotwell merged commit 440908c into laravel:5.x Mar 27, 2025
16 checks passed
@kohlerdominik
Copy link
Contributor

@cosmastech Thanks very much for the fix, greatly appreciated for our use-case.

Have you thought instead of just hard require text/plain header for your fix, inverting the condition (checking if it's a handled array-like as application/json or multipart/form-data), and fallback and assume it's at least text-compatible if it's not an explicit known arrayable?

This would add support for more text formats like text/xml, text/csv, text/yaml, application/xml, image/svg+xml and many more implicit.

@cosmastech cosmastech deleted the patch-1 branch April 2, 2025 11:28
@cosmastech
Copy link
Contributor Author

@cosmastech Thanks very much for the fix, greatly appreciated for our use-case.

You're very welcome. I had the exact same problem testing SNS webhooks 😅

Have you thought instead of just hard require text/plain header for your fix, inverting the condition (checking if it's a handled array-like as application/json or multipart/form-data), and fallback and assume it's at least text-compatible if it's not an explicit known arrayable?

This would add support for more text formats like text/xml, text/csv, text/yaml, application/xml, image/svg+xml and many more implicit.

That's definitely a good point. I probably won't have time to dedicate to PRing that change, but I would say that I could see value in it.

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.

Request payload of Content-Type: text/plain not shown
3 participants