From 8222d65ebe1085928ff3e7db9dd0bf7d0644ffae Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Sat, 24 Feb 2024 21:32:01 +1100 Subject: [PATCH] AP_Bootloader: make Content-Length handle case insensitive --- Tools/AP_Bootloader/network.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Tools/AP_Bootloader/network.cpp b/Tools/AP_Bootloader/network.cpp index eb47c09ef8067..64270187a8e66 100644 --- a/Tools/AP_Bootloader/network.cpp +++ b/Tools/AP_Bootloader/network.cpp @@ -484,10 +484,14 @@ void BL_Network::handle_request(SocketAPM *sock) sock->send(header, strlen(header)); if (strncmp(headers, "POST / ", 7) == 0) { - const char *clen = "\r\nContent-Length:"; - const char *p = strstr(headers, clen); + const char *clen1 = "\r\nContent-Length:"; + const char *clen2 = "\r\ncontent-length:"; + const char *p = strstr(headers, clen1); + if (p == nullptr) { + p = strstr(headers, clen2); + } if (p != nullptr) { - p += strlen(clen); + p += strlen(clen1); const uint32_t content_length = atoi(p); handle_post(sock, content_length); delete headers;