forked from 3scale/APIcast
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not send Proxy-Authorization when using Camel proxy policy
- Loading branch information
Showing
2 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,6 +318,7 @@ EOF | |
|
||
|
||
=== TEST 5: API backend connection uses http proxy with Basic Auth | ||
Check that the Proxy Authorization header is not sent | ||
--- configuration | ||
{ | ||
"services": [ | ||
|
@@ -358,7 +359,7 @@ EOF | |
access_by_lua_block { | ||
assert = require('luassert') | ||
local proxy_auth = ngx.req.get_headers()['Proxy-Authorization'] | ||
assert.equals(proxy_auth, "Basic Zm9vOmJhcg==") | ||
assert.falsy(proxy_auth) | ||
ngx.say("yay, api backend") | ||
} | ||
} | ||
|
@@ -371,6 +372,7 @@ yay, api backend | |
using proxy: http://foo:bar@127.0.0.1:$TEST_NGINX_HTTP_PROXY_PORT | ||
|
||
=== TEST 6: API backend using all_proxy with Basic Auth | ||
Check that the Proxy Authorization header is not sent | ||
--- configuration | ||
{ | ||
"services": [ | ||
|
@@ -411,7 +413,7 @@ using proxy: http://foo:[email protected]:$TEST_NGINX_HTTP_PROXY_PORT | |
access_by_lua_block { | ||
assert = require('luassert') | ||
local proxy_auth = ngx.req.get_headers()['Proxy-Authorization'] | ||
assert.equals(proxy_auth, "Basic Zm9vOmJhcg==") | ||
assert.falsy(proxy_auth) | ||
ngx.say("yay, api backend") | ||
} | ||
} | ||
|
@@ -425,6 +427,7 @@ using proxy: http://foo:[email protected]:$TEST_NGINX_HTTP_PROXY_PORT | |
|
||
|
||
=== TEST 7: using HTTPS proxy for backend with Basic Auth. | ||
Check that the Proxy Authorization header is not sent | ||
--- init eval | ||
$Test::Nginx::Util::PROXY_SSL_PORT = Test::APIcast::get_random_port(); | ||
$Test::Nginx::Util::ENDPOINT_SSL_PORT = Test::APIcast::get_random_port(); | ||
|
@@ -473,10 +476,6 @@ EOF | |
|
||
location /test { | ||
access_by_lua_block { | ||
assert = require('luassert') | ||
local proxy_auth = ngx.req.get_headers()['Proxy-Authorization'] | ||
assert.falsy(proxy_auth) | ||
|
||
ngx.say("yay, endpoint backend") | ||
|
||
} | ||
|
@@ -505,3 +504,5 @@ GET /test?user_key=test3 | |
<<EOF | ||
using proxy: http://foo:bar\@127.0.0.1:$Test::Nginx::Util::PROXY_SSL_PORT, | ||
EOF | ||
--- no_error_log eval | ||
[qr/\[error\]/, qr/\got header line: Proxy-Authorization: Basic Zm9vOmJhcg==/] |