Skip to content
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

Access to rawBody from request. #3230

Open
glani opened this issue Nov 20, 2023 · 1 comment
Open

Access to rawBody from request. #3230

glani opened this issue Nov 20, 2023 · 1 comment
Labels
🛠️ piece-framework Changes Related to Piece framework

Comments

@glani
Copy link

glani commented Nov 20, 2023

Is your feature request related to a problem? Please describe.

In the current implementation of the trigger context, the body has already been parsed.
However several services make a signature of body based on rawBody request.

for example: "tax_formatted":"\u20ac0.57","discount_total":1199,"total_formatted":"\u20ac3.57",
will be decoded to json:

"tax_formatted": "€0.57",
"discount_total": 1199,
"total_formatted": "€3.57",

as a result, it is impossible to restore the original rawBody.
In the end, the webhook signature is incorrect.

Describe the solution you'd like
context should have access to raw text body in case of json/urlencode-form request

Describe alternatives you've considered
as a workaround I switched off the trigger signaturecheck

Additional context
THe example of the system that uses such approach (signature against rawBody): https://docs.lemonsqueezy.com/help/webhooks

@abuaboud
Copy link
Contributor

On point, marking it as piece framework issue

@abuaboud abuaboud added the 🛠️ piece-framework Changes Related to Piece framework label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠️ piece-framework Changes Related to Piece framework
Projects
Status: No status
Development

No branches or pull requests

2 participants