fix: duplicate User-Agent header on wolfSSL requests breaks strict servers (aiohttp 400) (#2661)

This commit is contained in:
Dylan Byars
2026-07-21 01:48:26 -04:00
committed by GitHub
parent cb9b971c26
commit 973a902332
+4 -1
View File
@@ -58,7 +58,10 @@ HttpDownloader::DownloadError runGetWolf(const std::string& startUrl, const std:
LOG_ERR("HTTP", "wolfSSL bad URL: %s", url.c_str());
return HttpDownloader::HTTP_ERROR;
}
http.addHeader("User-Agent", "CrossPoint-ESP32-" CROSSPOINT_VERSION);
// setUserAgent replaces SecureHttpClient's built-in UA; addHeader would
// append a second User-Agent header, which strict servers reject (aiohttp
// answers 400 "Duplicate 'User-Agent' header found").
http.setUserAgent("CrossPoint-ESP32-" CROSSPOINT_VERSION);
if (!username.empty() && !password.empty()) {
const std::string credentials = username + ":" + password;
const String encoded = base64::encode(credentials.c_str());