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

Fix invalid assumption that multipart forms can be parsed in te same way as urlencoded forms. #360

Merged
merged 3 commits into from
Dec 2, 2019

Conversation

adnanh
Copy link
Owner

@adnanh adnanh commented Dec 2, 2019

Refactored code to use switch-case statement over the Content-Type header and log unsupported content types instead of silently failing.

Also made the x-www-form-urlencoded content type handler more specific (as opposed to the previous code which looked for form occurence in the value),
as we need to use different logic for multipart forms, which we'll hopefully implement soon.

…the same way as urlencoded forms.

Refactored code to use switch-case statement over the `Content-Type` header and log unsupported content types instead of silently failing.
Also made the `x-www-form-urlencoded` content type handler more specific (as opposed to the previous code which looked for `form` occurence in the value),
as we need to use different logic for multipart forms, which we'll hopefully implement soon.

The issue with multipart forms that we have to handle first is that the files are being written to temporary files, and as such, for async hooks
webhook cannot guarantee they'll be available after we close the request; that, and the fact that we don't have code that will properly serialize
and pass such Golang objects to the script, as there are several fields which might be interesting to the end user.
@adnanh adnanh requested a review from moorereason December 2, 2019 18:05
@adnanh adnanh changed the base branch from master to development December 2, 2019 18:05
@adnanh adnanh merged commit 9117f4f into development Dec 2, 2019
@adnanh adnanh deleted the improvement/content-type-based-payload-parsing branch December 2, 2019 21:33
@moorereason moorereason added this to the 2.6.11 milestone Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants