ExpressGateway / express-gateway

A microservices API Gateway built on top of Express.js
https://www.express-gateway.io
Apache License 2.0
2.97k stars 347 forks source link

[Question] Proxy changeOrigin not doing anything #985

Open jclaessens97 opened 4 years ago

jclaessens97 commented 4 years ago

How I understand is the changeProxy option in the proxy policy meant to change he origin header to the gateway's origing and not from the e.g. browser's origin right?

If that's not what it's meant to do, please correct me and explain what it is meant to do 😉

If that IS what it's meant to do, it doesn't seem to work:

- proxy:
          action:
                serviceEndpoint: coreService
                changeOrigin: true

True or false, the origin I receive in my backend is always the origin of the browser and not of my gateway. I only want to allow the CORS from the gateway, not from the frontend if that's possible.

Thanks!

NomadXD commented 4 years ago

@jclaessens97 Did you find a solution ?

jclaessens97 commented 4 years ago

It was just a poc so I ended with adding the original origin to the CORS config, but no real solution found.

chrisrichard commented 4 years ago

changeOrigin adjusts the Host header on the outgoing request, not the Origin header.