Skip to content

Commit

Permalink
fix(clustering): hybrid mode should accept special characters used in…
Browse files Browse the repository at this point in the history
… forward proxy password
  • Loading branch information
ms2008 committed Aug 6, 2024
1 parent db8da59 commit 0d48844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: Fixed an issue where hybrid mode not working if the forward proxy password contains special character(#). Note that the `proxy_server` configuration parameter still needs to be url-encoded.
type: bugfix
scope: Clustering
3 changes: 2 additions & 1 deletion kong/clustering/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local type = type
local table_insert = table.insert
local table_concat = table.concat
local encode_base64 = ngx.encode_base64
local unescape_uri = ngx.unescape_uri
local worker_id = ngx.worker.id
local fmt = string.format

Expand Down Expand Up @@ -50,7 +51,7 @@ local function parse_proxy_url(proxy_server)
end

if parsed.user and parsed.password then
ret.proxy_authorization = "Basic " .. encode_base64(parsed.user .. ":" .. parsed.password)
ret.proxy_authorization = "Basic " .. encode_base64(unescape_uri(parsed.user) .. ":" .. unescape_uri(parsed.password))
end
end

Expand Down

0 comments on commit 0d48844

Please sign in to comment.