Fix: URL-encode password in Duet::get_connect_url (#8215)

Signed-off-by: Toure Dunnon <tdunnon@gmail.com>
This commit is contained in:
Toure Dunnon 2025-01-28 02:34:29 -05:00 committed by GitHub
parent 6ed68342e0
commit f620879eb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,7 +205,7 @@ std::string Duet::get_connect_url(const bool dsfUrl) const
} else { } else {
return (boost::format("%1%rr_connect?password=%2%&%3%") return (boost::format("%1%rr_connect?password=%2%&%3%")
% get_base_url() % get_base_url()
% (password.empty() ? "reprap" : password) % Http::url_encode(password.empty() ? "reprap" : password) // url_encode is needed because password can contain special characters like `&`, "#", etc.
% timestamp_str()).str(); % timestamp_str()).str();
} }
} }