-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: environment variable values mixed in proxy-rewrite plugin #11121
Comments
Yes, Maybe I can reproduce, But I don't know why . |
when wrong case: when right case: some wrong in read config . |
I have trace
wrong case: some times, os.getenv return wrong value .... |
It works fine when I prefix them with some different random strings, like: ZCBSFN_SOME_STRING_VALUE and UITUFK_SOME_STRING_VALUE_BUT_DIFFERENT. So it seems to be related to that the variable names start with same string. But still a short variable names like VALUE_A and VALUE_B works. |
Actually it seems to be matter of just if the prefix or suffix of the variable name is different it works. But if other variable name is just a subset of the other, then it fails. |
I tested with the case below on v3.2 with no problem.
|
@jompu
|
Current Behavior
The proxy-rewrite plugin uses value from wrong environment variable, when configured with standalone configuration.
The problem is that some times the values at step 2 are like this (which is wrong):
X-Some-String-Value: "astringvalue"
X-Some-String-Value-But-Different: "Different astringvalue"
Expected Behavior
Header values should be like this:
X-Some-String-Value: "astringvalue"
X-Some-String-Value-But-Different: "Different astringvaluebutdifferent"
Error Logs
No response
Steps to Reproduce
config.yaml
apisix.yaml
The issue does not happen always, anyway try below steps multiple times and it happens at some point. Quite often it happens at the first time though. The apisix.yaml is just an example that I have used to reproduce the problem.
curl -H "X-random-request-header: astringvalue" http://localhost:9999/test
X-Some-String-Value: "astringvalue"
X-Some-String-Value-But-Different: "Different astringvaluebutdifferent"
The problem is that some times the values at step 2 are like this (which is wrong):
X-Some-String-Value: "astringvalue"
X-Some-String-Value-But-Different: "Different astringvalue"
Restarting the pod or just reloading the configuration (e.g. by editing apisix.yaml file) will fix the problem.
A script to run steps repeatedly and stop when the issue happens:
Environment
The text was updated successfully, but these errors were encountered: