Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/falcon/middleware/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Proxy < Protocol::HTTP::Middleware
"keep-alive",
"public",
"proxy-authenticate",
"proxy-authorization",
"transfer-encoding",
"upgrade",
]
Expand Down
10 changes: 10 additions & 0 deletions test/falcon/middleware/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ def proxy_for(**options)

let(:headers) {Protocol::HTTP::Headers["accept" => "*/*"]}

it "removes proxy authorization by default" do
headers = Protocol::HTTP::Headers[
"authorization" => "Bearer application",
"proxy-authorization" => "Basic proxy",
]
proxy.prepare_headers(headers)
expect(headers["authorization"]).to be == "Bearer application"
expect(headers["proxy-authorization"]).to be == nil
Comment thread
samuel-williams-shopify marked this conversation as resolved.
Outdated
end

it "can select client based on authority" do
request = Protocol::HTTP::Request.new("https", "www.google.com", "GET", "/", nil, headers, nil)

Expand Down
Loading