Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cors plugin return repeated cross-domain header #1704

Closed
Donghui0 opened this issue Jun 12, 2020 · 7 comments
Closed

bug: cors plugin return repeated cross-domain header #1704

Donghui0 opened this issue Jun 12, 2020 · 7 comments

Comments

@Donghui0
Copy link
Contributor

Issue description

When the backend also returns cross-domain headers, using cors plugin will cause duplicate cross-domain headers
for example:
backend code set header:

image

enable cors plugin, then response header like this :

image

Environment

  • apisix version (cmd: apisix version): 1.2
  • OS: centos7.6

What's the expected result?

remove duplicate headers

@membphis
Copy link
Member

If we want to remove the duplicate header, should we keep the upstream or the newly set value of the plugin?

@moonming
Copy link
Member

@ShiningRush please take a look. Myabe we can overwrite the headers from upstream?

@ShiningRush
Copy link
Contributor

I think we can add a parameter to control if overwrite the headers of upstream, such as "is_overwrite_upstream".
@membphis @moonming How about it ?

@moonming
Copy link
Member

default value is false or ture for is_overwrite_upstream?

@ShiningRush
Copy link
Contributor

I think false is better, upstream should be high priority

@ShiningRush
Copy link
Contributor

After I talk with @membphis , I remove the option of is_overwrite_upstream, because we want plugin as simple as possible.
Now the plugin will overwrite upstream header defaultly.

@membphis
Copy link
Member

membphis commented Aug 7, 2020

ok, got it. we can close this issue now.

@membphis membphis closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants