typebot.io icon indicating copy to clipboard operation
typebot.io copied to clipboard

Webhooks failing blocked by CORS policy

Open kmain4 opened this issue 1 year ago • 2 comments

TypeBot webhooks are failing due to CORS policy:

Access to fetch at 'https://bot...../executeWebhook' from origin 'https://builder.......' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

kmain4 avatar Jul 07 '22 17:07 kmain4

When executing a webhook in the Typebot Builder, the request fails.

Chrome reports:

A cross-origin resource sharing (CORS) request was blocked because it contained request headers that were neither CORS-safelisted (Accept, Accept-Language, Content-Language, Content-Type) nor allowed by the Access-Control-Allow-Headers response header of the associated preflight request.
To fix this issue, include the additional request headers you want to use in the Access-Control-Allow-Headers response header of the associated preflight request.

Disallowed header: content-type

kmain4 avatar Jul 07 '22 19:07 kmain4

I resolved this in my environment by forcing the related CORS policy on my proxy (Traefik), but I still believe the setting should be set via Typebot and requires further investigation.

kmain4 avatar Jul 07 '22 19:07 kmain4

Closing this as I couldn't reproduce and nobody else seems to have this issue for now.

Feel free to reopen if we gather more information.

baptisteArno avatar Sep 01 '22 06:09 baptisteArno