From beea582ddff8879e94484f84202307c488f30a70 Mon Sep 17 00:00:00 2001 From: Zeping Bai Date: Mon, 10 Jan 2022 17:00:49 +0800 Subject: [PATCH] test: extend APISIX generated headers check --- t/plugin/forward-auth.t | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/t/plugin/forward-auth.t b/t/plugin/forward-auth.t index 9e47d9b41a48..f379fff16bf7 100644 --- a/t/plugin/forward-auth.t +++ b/t/plugin/forward-auth.t @@ -212,15 +212,17 @@ Location: http://example.com/auth -=== TEST 6: hit route (ignore client X-Forwarded-XXX headers) +=== TEST 6: hit route (check APISIX generated headers and ignore client headers) --- request GET /hello --- more_headers Authorization: 444 X-Forwarded-Host: apisix.apache.org --- error_code: 403 ---- response_body_like eval -qr/\"x-forwarded-host\":\"localhost\"/ +--- response_body eval +qr/\"x-forwarded-proto\":\"http\"/ and qr/\"x-forwarded-method\":\"GET\"/ and +qr/\"x-forwarded-host\":\"localhost\"/ and qr/\"x-forwarded-uri\":\"\\\/hello\"/ and +qr/\"x-forwarded-for\":\"127.0.0.1\"/ --- response_body_unlike eval qr/\"x-forwarded-host\":\"apisix.apache.org\"/