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

feat: Add support for inbound webhooks that use form data #1998

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

BolajiOlajide
Copy link
Contributor

Closes #1987

This PR adds support for inbound webhooks that send data via form-data. It defaults to JSON when the content type isn't multipart/form-data to avoid introducing a breaking change. As time goes one, we'll want to add support for www-url-encoded.

CleanShot 2024-05-07 at 01 52 44@2x
CleanShot 2024-05-07 at 01 52 38@2x

@@ -37,3 +37,6 @@ typesense_data
postgres_data
redis_data
/.run/go test github.com_frain-dev_convoy_server.run.xml

convoy-ee
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to remove this, however I added this because it is an artifact introduced by the make build command and since it's user-generated, it thus makes sense that it is ignored by default.

@CLAassistant
Copy link

CLAassistant commented May 7, 2024

CLA assistant check
All committers have signed the CLA.

@jirevwe
Copy link
Collaborator

jirevwe commented May 15, 2024

Shouldn't the JOSN payload received at the endpoint be this?

{
    "name": "legbegbe",
    "error": "no error",
    "status": "success"
}

@BolajiOlajide
Copy link
Contributor Author

BolajiOlajide commented May 15, 2024

Shouldn't the JOSN payload received at the endpoint be this?

{
    "name": "legbegbe",
    "error": "no error",
    "status": "success"
}

@jirevwe You're right. However, I did it that way because the return type of FormData is actually a map of the structure type Values map[string][]string. I left it that way to preserve the parsing incase something changes, WDYT?

@BolajiOlajide
Copy link
Contributor Author

@jirevwe Updated.

CleanShot 2024-05-17 at 01 51 30@2x
CleanShot 2024-05-17 at 01 51 21@2x

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.

[Feature request]: Add support for inbound webhooks that use form data
3 participants