How to handle preflight /OPTIONS request on a webhook?

How can I handle preflight /OPTIONS request on a webhook?

i need it for send credential from a htmx request

htmx.config.withCredentials defaults to false, allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

i see we can add options with the settings below and we can add custom headers but it seems not works :S

this is my configuration

i have try with respond immediatly or with the node but not works

Someone can help?

Hey @mredodos

We don’t support OPTIONS in the webhook node as an option, I would expect your cors headers to only kick in if you were making a GET or PUT request, have you tried making a call with something like curl directly to see what is being sent?

If you do need the OPTIONS method then I would either create a feature requests for that or handle it outside of n8n like in your reverse proxy.

1 Like

Yes pls add a feature request :smiley:

pratically htmx made a pre http request and i need to set OPTIONS if i want to set some security settings

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.