Cors request are block

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.

HOW TO HANDEL THIS TO GET REQUEST FROM MY OWN SERVER

Hi @Gaurav_Garg :wave:

Can you share a little bit about your setup: * n8n version:

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

And can you also post the contents of your docker-compose file (please redact any sensitive information like credentials)!

  • Database (default: SQLite): yes
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (npm,
  • Operating system: ubantu

Hi @Gaurav_Garg, n8n does not have support for all relevant HTTP methods required to handle CORS unfortunately. The webhook node would not support OPTIONS requests for example. I really wish it was different but that’s unfortunately the current status.

So for the time being you would need to implement this on a reverse proxy level, similar to what @roemhildtg described over here for example.

Alternatively, you could consider using a designated webhook router such as Hookdeck or Convoy to receive the webhooks and forward them to n8n. These are likely better equipped to handle browser requests, check for example this post on the Cloudron forums discussing a similar problem.

2 Likes

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