From 973a90233232f03bf1a697f4375e931cf84f6dab Mon Sep 17 00:00:00 2001 From: Dylan Byars Date: Tue, 21 Jul 2026 01:48:26 -0400 Subject: [PATCH] fix: duplicate User-Agent header on wolfSSL requests breaks strict servers (aiohttp 400) (#2661) --- src/network/HttpDownloader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/HttpDownloader.cpp b/src/network/HttpDownloader.cpp index 9179d5a4..44a5a543 100644 --- a/src/network/HttpDownloader.cpp +++ b/src/network/HttpDownloader.cpp @@ -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());