Skip to content

Commit 4d0ca94

Browse files
airweenFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Modified the false pos. UNMATCHED_BOUNDARY error flag
1 parent af4afd3 commit 4d0ca94

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/request_body_processor/multipart.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,9 +1483,15 @@ bool Multipart::process(const std::string& data, std::string *error,
14831483
m_boundary.size()) == 0)) {
14841484
char *boundary_end = m_buf + 2 + m_boundary.size();
14851485
/* if it match, AND there was a matched boundary at least,
1486-
clear the m_flag_unmatched_boundary flag */
1486+
set the m_flag_unmatched_boundary flag to 2
1487+
this indicates that there were an opened boundary, which
1488+
matches the reference, and here is the final boundary.
1489+
The flag will differ from 0, so the previous rules ("!@eq 0")
1490+
will catch all "errors", without any modification, but we can
1491+
use the new, permission mode with "@eq 1"
1492+
*/
14871493
if (m_boundary_count > 0) {
1488-
m_flag_unmatched_boundary = 0;
1494+
m_flag_unmatched_boundary = 2;
14891495
}
14901496
int is_final = 0;
14911497

0 commit comments

Comments
 (0)