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

Netlify CLI server does not properly handle content-type to determine base64 body #4237

Closed
kiliman opened this issue Feb 8, 2022 · 0 comments · Fixed by #4240
Closed

Netlify CLI server does not properly handle content-type to determine base64 body #4237

kiliman opened this issue Feb 8, 2022 · 0 comments · Fixed by #4240
Labels
type: bug code to address defects in shipped code

Comments

@kiliman
Copy link

kiliman commented Feb 8, 2022

Currently when the server checks shouldBase64Encode() it's passing in the content-type header. This function makes a series of checks and compares to an exclusion list. However, if the content-type header is something like application/json; charset=utf-8 segment, this causes the exclusion list to not match and always returns true.

Oddly, even though isBase64Encoded is true, it doesn't seem to encode it to base64 data. So when processing the event and checking isBase64Encoded and converting from base64, it results in invalid binary data.

This was found while debugging a Remix/Stripe integration that only failed on the Netlify adapter. See this Discord thread for more details.

https://discord.com/channels/770287896669978684/940734316298797076/940739970874867793

@kiliman kiliman added the type: bug code to address defects in shipped code label Feb 8, 2022
@kodiakhq kodiakhq bot closed this as completed in #4240 Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant