2

I use the CORS plugin with Kong ingress controller, whitin Postman, the API works great, the response includes an

Access-Control-Allow-Origin: *

header.

But when I made cors request in Chrome, it report:

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Edge report:

The server has not found anything matching the requested URI (Uniform Resource Identifier).

My upstream service is a express/node app, I already set the cors middleware, but it seems the preflight HTTP OPTIONS request won't go through or get response from the Kong gateway.

And I noticed the plugin has an limitation.

But I don't know to configure my KongIngress object to overcome this limitation in broswer for cors request.

Franci
  • 2,157
  • 1
  • 21
  • 33
  • 1
    Changed to gloo :sad – Franci Jun 18 '20 at 05:16
  • Is the necessary header actually included in the request? Your express/node app could be limiting the size of headers, as it's default is kinda small. You can try passing `--max-http-header-size=100000` or something like that to .node options and verify the headers is actually present when reaching the ingress – LeadingMoominExpert Oct 04 '21 at 08:14

0 Answers0