You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix allow_cors: true returning two Access-Control-Allow-Origin headers (#489)
* fix: `allow_cors: true` returning two `Access-Control-Allow-Origin` headers
Fixes#93.
The `Access-Control-Allow-Origin` was set before on the response before the proxy call,
and ClickHouse was returning the response with its own `Access-Control-Allow-Origin` (in my case, "*").
So, having `allow_cors: true` was eventually returning two `Access-Control-Allow-Origin`, one from chproxy and one from ClickHouse.
This commit just move the `"Access-Control-Allow-Origin` after the proxy call, overriding the value returned by ClickHouse.
If `allow_cors: false`, chproxy does not change the value (so it can be, I believe, any value set by ClickHouse), else, with `allow_cors: true`,
it will override to either the value of `Origin` request if any or else `*`.
* fix: add tests for allow CORS behavior
* fix failing tests
* add failing test
* fix failing tests
* add TODO
---------
Co-authored-by: Christophe Kalenzaga <mgachka@aol.com>
0 commit comments