Skip to content

Commit 89f433e

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 093d639 commit 89f433e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/WebRequest.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,18 @@ bool AsyncWebServerRequest::_parseReqHeader() {
540540
}
541541
// Strip the surrounding quotes; content between them is the boundary.
542542
_boundary = _boundary.substring(1, endQuote);
543+
544+
// Unescape quoted-pair sequences so the boundary matches the actual bytes on the wire.
545+
String unescaped;
546+
unescaped.reserve(_boundary.length());
547+
for (size_t i = 0; i < _boundary.length(); ++i) {
548+
char c = _boundary.charAt(i);
549+
if (c == '\\' && (i + 1) < _boundary.length()) {
550+
c = _boundary.charAt(++i);
551+
}
552+
unescaped += c;
553+
}
554+
_boundary = unescaped;
543555
} else {
544556
// Token form: the value ends at the next ';' (start of the next
545557
// parameter) or at the end of the header field.

0 commit comments

Comments
 (0)