-
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: enable_websocket be set to true in upstream_id config does not work #7187
Comments
enable_websocket should be configured in the route. As you can find out that it's missing in the upstream's doc. We keep the old code just for the compatible but it doesn't mean it can work with upstream_id. I am curious why you will set it in the upstream as this field should already be removed from the doc? |
I have already forgotten where I read the usage of setting it in the upstream.😂 |
@sasakiyori |
@spacewander Do you mean completely remove the logic about |
Yes, PR is welcome! |
Current Behavior
I register a route by script like below:
When I call the request, I found in upstream nodes,
Connection
andUpgrade
was not in the request headers,enable_websocket
did not work.Expected Behavior
I expects
enable_websocket
will work, and the request headers should containConnection
andUpgrade
.Actually when I use
upstream
directly instead of usingupstream_id
,enable_websocket
works normally.When I set
enable_websocket
inroutes
setting, it works too.Error Logs
I found that when I use
upstream_id
setting, the code does not concern about the value ofenable_websocket
, which will setConnection
andUpgrade
headers later. Butupstream
does condition checks for it,route
androute.service_id
checks as well.https://github.com/apache/apisix/blob/master/apisix/init.lua#L463
Steps to Reproduce
Environment
apisix version
): 2.13.0uname -a
): Linux 0c06ebd3850b 5.10.76-linuxkit # 1 SMP Mon Nov 8 10:21:19 UTC 2021 x86_64 Linuxopenresty -V
ornginx -V
): openresty/1.19.3.2curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: