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: stand alone mode proxy-rewrite headers has bug #1604

Closed
andyindr opened this issue May 21, 2020 · 7 comments
Closed

bug: stand alone mode proxy-rewrite headers has bug #1604

andyindr opened this issue May 21, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@andyindr
Copy link

Issue description

under stand alone mode
the proxy-rewrite headers has bug

https://github.com/apache/incubator-apisix/blob/master/apisix/plugins/proxy-rewrite.lua
this plugin under stand alone , after set apisix.yaml
the check_schema function no use, only execute rewrite

so headers_arr not exist

the bug result is apisix.yaml content:

proxy-rewrite:
headers_arr: ["X-Api-Version", "v1", "X-Api-Engine", "apisix", "X-Api-useless", "6666"]

only this format can used

Environment

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

Minimal test code / Steps to reproduce the issue

1.proxy-rewrite:
headers:
2.
3.

What's the actual result? (including assertion message & call stack if applicable)

custom header not useful

What's the expected result?

custom header can useful

@moonming
Copy link
Member

@membphis please take a look

@membphis
Copy link
Member

@andyindr please provide a fully config of conf/apisix.yaml

we need it .

@membphis
Copy link
Member

we need to check schema after we got the conf, here is an example:

if data_valid and self.item_schema then
    data_valid, err = check_schema(self.item_schema, item.value)
    if not data_valid then
        log.error("failed to check item data of [", self.key,
                    "] err:", err, " ,val: ", json.encode(item.value))
    end
end

Here is the code for config_etcd:
https://github.com/apache/incubator-apisix/blob/master/apisix/core/config_etcd.lua#L169

@membphis
Copy link
Member

and we need to update this file: https://github.com/apache/incubator-apisix/blob/master/apisix/core/config_yaml.lua

@nic-chen do you have time to fix this bug?

@membphis membphis added the bug Something isn't working label Jul 16, 2020
@wrl96
Copy link
Contributor

wrl96 commented Jul 16, 2020

@membphis I have resolved this bug. pls assign it to me

@membphis membphis removed their assignment Jul 16, 2020
@membphis
Copy link
Member

@wrl96 please feel free to submit your PR, waiting for it ^_^

@spacewander
Copy link
Member

Fixed by #2856

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants