diff --git a/t/admin/routes4.t b/t/admin/routes4.t index 3c799be8be90..ba9ff44142e3 100644 --- a/t/admin/routes4.t +++ b/t/admin/routes4.t @@ -611,7 +611,7 @@ failed to read request body: request size 1678025 is greater than the maximum si "methods": ["GET", "GET"], "upstream": { "nodes": { - "httpbin.org:8080": 1, + "apisix.com:8080": 1, "test.com:8080": 1 }, "type": "roundrobin", diff --git a/t/admin/upstream4.t b/t/admin/upstream4.t index 99c840f944f1..b657edc6e731 100644 --- a/t/admin/upstream4.t +++ b/t/admin/upstream4.t @@ -205,7 +205,7 @@ passed ngx.HTTP_PUT, [[{ "nodes": { - "httpbin.org:8080": 1, + "apisix.com:8080": 1, "test.com:8080": 1 }, "type": "roundrobin", diff --git a/t/config-center-yaml/route-upstream.t b/t/config-center-yaml/route-upstream.t index 53b9d51d3fb2..d5353a449332 100644 --- a/t/config-center-yaml/route-upstream.t +++ b/t/config-center-yaml/route-upstream.t @@ -140,17 +140,17 @@ hello world routes: - id: 1 - uri: /get + uri: /hello upstream_id: 1 upstreams: - id: 1 nodes: - "httpbin.org:80": 1 + "test.com:1980": 1 type: roundrobin #END --- request -GET /get +GET /hello --- error_code: 200 @@ -161,19 +161,19 @@ GET /get routes: - id: 1 - uri: /get + uri: /hello upstream_id: 1 upstreams: - id: 1 nodes: - "httpbin.org:80": 1 + "test.com:1980": 1 type: chash hash_on: header key: "$aaa" #END --- request -GET /get +GET /hello --- error_code: 502 --- error_log invalid configuration: failed to match pattern diff --git a/t/node/merge-route.t b/t/node/merge-route.t index 474e08abbd13..b09b272cf795 100644 --- a/t/node/merge-route.t +++ b/t/node/merge-route.t @@ -235,10 +235,10 @@ qr/merge_service_route.*"time_window":60/] ngx.HTTP_PUT, [[{ "upstream": { - "scheme": "https", + "scheme": "http", "type": "roundrobin", "nodes": { - "httpbin.org:443": 1 + "test.com:1980": 1 } } }]] @@ -266,10 +266,10 @@ passed ngx.HTTP_PUT, [[{ "uri": "/fake", - "host": "httpbin.org", + "host": "test.com", "plugins": { "proxy-rewrite": { - "uri": "/get" + "uri": "/echo" } }, "service_id": "1" @@ -293,10 +293,9 @@ passed --- request GET /fake --- more_headers -host: httpbin.org ---- response_body eval -qr/"Host": "httpbin.org"/ ---- timeout: 5 +host: test.com +--- response_headers +host: test.com @@ -304,7 +303,7 @@ qr/"Host": "httpbin.org"/ --- request GET /fake --- more_headers -host: httpbin.orgxxx +host: test.comxxx --- error_code: 404 diff --git a/t/node/route-domain.t b/t/node/route-domain.t index 316f8c166c46..6fb376b83d5e 100644 --- a/t/node/route-domain.t +++ b/t/node/route-domain.t @@ -115,8 +115,7 @@ passed --- request GET /echo --- response_headers -Host: test.com ---- timeout: 10 +host: test.com @@ -157,8 +156,7 @@ passed --- request GET /echo --- response_headers -Host: test.com:1980 ---- timeout: 10 +host: test.com:1980 diff --git a/t/node/upstream-domain.t b/t/node/upstream-domain.t index 35dccbb5ee04..24048467f390 100644 --- a/t/node/upstream-domain.t +++ b/t/node/upstream-domain.t @@ -110,7 +110,7 @@ qr/dns resolver domain: foo.com to \d+.\d+.\d+.\d+/ ngx.HTTP_PUT, [[{ "nodes": { - "httpbin.orgx:80": 0 + "test.comx:80": 0 }, "type": "roundrobin", "desc": "new upstream" @@ -150,8 +150,8 @@ GET /t status: 503 status: 503 --- error_log -failed to parse domain: httpbin.orgx -failed to parse domain: httpbin.orgx +failed to parse domain: test.comx +failed to parse domain: test.comx --- timeout: 10 diff --git a/t/node/upstream.t b/t/node/upstream.t index b5d3acf2a121..c99b10aecad6 100644 --- a/t/node/upstream.t +++ b/t/node/upstream.t @@ -205,7 +205,7 @@ GET /t ngx.HTTP_PUT, [[{ "nodes": { - "httpbin.org:80": 1 + "test.com:1980": 1 }, "type": "roundrobin", "desc": "new upstream", @@ -234,7 +234,7 @@ passed local code, body = t('/apisix/admin/routes/1', ngx.HTTP_PUT, [[{ - "uri": "/get", + "uri": "/echo", "upstream_id": "1" }]] ) @@ -254,9 +254,9 @@ passed === TEST 12: hit route --- request -GET /get ---- response_body eval -qr/"Host": "httpbin.org"/ +GET /echo +--- response_headers +host: test.com:1980 @@ -274,7 +274,7 @@ qr/"Host": "httpbin.org"/ "type": "roundrobin", "desc": "new upstream", "pass_host": "rewrite", - "upstream_host": "httpbin.org" + "upstream_host": "test.com" }]] ) @@ -299,7 +299,7 @@ passed local code, body = t('/apisix/admin/routes/1', ngx.HTTP_PUT, [[{ - "uri": "/uri", + "uri": "/echo", "upstream_id": "1" }]] ) @@ -319,9 +319,9 @@ passed === TEST 15: hit route --- request -GET /uri ---- response_body eval -qr/host: httpbin.org/ +GET /echo +--- response_headers +host: test.com diff --git a/t/plugin/authz-casdoor.t b/t/plugin/authz-casdoor.t index 926d3daef97a..25fab487a29d 100644 --- a/t/plugin/authz-casdoor.t +++ b/t/plugin/authz-casdoor.t @@ -129,12 +129,15 @@ done "endpoint_addr":"]] .. fake_uri .. [[", "client_id":"7ceb9b7fda4a9061ec1c", "client_secret":"3416238e1edf915eac08b8fe345b2b95cdba7e04" + }, + "proxy-rewrite": { + "uri": "/echo" } }, "upstream": { "type": "roundrobin", "nodes": { - "httpbin.org:80": 1 + "test.com:1980": 1 } } }]] @@ -466,12 +469,15 @@ apisix: "endpoint_addr": "http://127.0.0.1:10420", "client_id":"7ceb9b7fda4a9061ec1c", "client_secret":"3416238e1edf915eac08b8fe345b2b95cdba7e04" + }, + "proxy-rewrite": { + "uri": "/echo" } }, "upstream": { "type": "roundrobin", "nodes": { - "httpbin.org:80": 1 + "test.com:1980": 1 } } }]] diff --git a/t/plugin/jwt-auth3.t b/t/plugin/jwt-auth3.t index 7daf6cf164a3..3ab089a974c6 100755 --- a/t/plugin/jwt-auth3.t +++ b/t/plugin/jwt-auth3.t @@ -280,11 +280,11 @@ hello: world }, "upstream": { "nodes": { - "httpbin.org:80": 1 + "test.com:1980": 1 }, "type": "roundrobin" }, - "uri": "/get" + "uri": "/hello" }]] ) @@ -299,11 +299,11 @@ hello: world === TEST 12: verify (in cookie) with hiding credentials --- request -GET /get +GET /hello --- more_headers Cookie: hello=world; jwt-cookie=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1c2VyLWtleSIsImV4cCI6MTg3OTMxODU0MX0.fNtFJnNmJgzbiYmGB0Yjvm-l6A6M4jRV1l4mnVFSYjs; foo=bar ---- response_body eval -qr/hello=world; foo=bar/ +--- response_body +hello world diff --git a/t/plugin/proxy-mirror.t b/t/plugin/proxy-mirror.t index 9c58f4bac98e..031737d50a13 100644 --- a/t/plugin/proxy-mirror.t +++ b/t/plugin/proxy-mirror.t @@ -705,8 +705,8 @@ passed [[{ "plugins": { "proxy-mirror": { - "host": "http://httpbin.org", - "path": "/get" + "host": "http://test.com:1980", + "path": "/hello" } }, "upstream": { @@ -736,7 +736,7 @@ GET /hello --- response_body hello world --- error_log_like eval -qr/http:\/\/httpbin\.org is resolved to: http:\/\/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/ +qr/http:\/\/test\.com is resolved to: http:\/\/((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}/