We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 093d639 commit 89f433eCopy full SHA for 89f433e
1 file changed
src/WebRequest.cpp
@@ -540,6 +540,18 @@ bool AsyncWebServerRequest::_parseReqHeader() {
540
}
541
// Strip the surrounding quotes; content between them is the boundary.
542
_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;
555
} else {
556
// Token form: the value ends at the next ';' (start of the next
557
// parameter) or at the end of the header field.
0 commit comments