Skip to content

Commit

Permalink
fix: URL-decode proxy username and password
Browse files Browse the repository at this point in the history
In cases where the proxy username or password contains characters that
cannot show up in URLs, they should be URL-encoded.

This is to ensure backwards compatibility with the Mender client
3.

Unfortunately, tinyproxy considers all special characters in the
BasicAuth configuration entry as syntax error so we have no way
to test this.

Ticket: MEN-7402
Changelog: none
Signed-off-by: Vratislav Podzimek <vratislav.podzimek@northern.tech>
  • Loading branch information
vpodzime committed Jul 23, 2024
1 parent cd14f51 commit f59adfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/http/platform/beast/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static inline error::Error AddProxyAuthHeader(OutgoingRequest &req, BrokenDownUr
// nothing to do
return error::NoError;
}
auto creds = proxy_address.username + ":" + proxy_address.password;
auto creds = URLDecode(proxy_address.username) + ":" + URLDecode(proxy_address.password);
auto ex_encoded_creds = crypto::EncodeBase64(common::ByteVectorFromString(creds));
if (!ex_encoded_creds) {
return ex_encoded_creds.error();
Expand Down

0 comments on commit f59adfb

Please sign in to comment.