spacewander commented on a change in pull request #6600:
URL: https://github.com/apache/apisix/pull/6600#discussion_r827562623
##########
File path: t/node/upstream.t
##########
@@ -510,3 +510,125 @@ GET /uri
qr/host: localhost/
--- error_log
proxy request to 127.0.0.1:1980
+
+
+
+=== TEST 21: check that including port in host header is supported when
pass_host = node and port is not standard
+--- config
+ location /t {
+ content_by_lua_block {
+ local t = require("lib.test_admin").test
+ local code, body = t('/apisix/admin/upstreams/1',
+ ngx.HTTP_PUT,
+ [[{
+ "nodes": {
+ "127.0.0.1:1979": 1,
+ "localhost:1980": 1000
+ },
+ "type": "roundrobin",
+ "pass_host": "node"
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ ngx.say(body)
+ return
+ end
+
+ local code, body = t('/apisix/admin/routes/1',
+ ngx.HTTP_PUT,
+ [[{
+ "methods": ["GET"],
+ "upstream_id": "1",
+ "uri": "/uri"
+ }]]
+ )
+
+ if code >= 300 then
+ ngx.status = code
+ end
+ ngx.say(body)
+ }
+ }
+--- request
+GET /t
+--- skip_nginx: 5: < 1.19.0
+--- response_body
+passed
+--- no_error_log
+[error]
+
+
+
+=== TEST 22: hit route
+--- request
+GET /uri
+--- skip_nginx: 5: < 1.19.0
+--- response_body
Review comment:
we can use:
```
--- response_body eval
qr/host: localhost:1980/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]