Skip to content

Commit af4afd3

Browse files
airweenFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Fixed false positive MULTIPART_UNMATCHED_BOUNDARY errors
1 parent 95048d5 commit af4afd3

File tree

2 files changed

+451
-0
lines changed

2 files changed

+451
-0
lines changed

Diff for: src/request_body_processor/multipart.cc

+5
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,11 @@ bool Multipart::process(const std::string& data, std::string *error,
14821482
&& (strncmp(m_buf + 2, m_boundary.c_str(),
14831483
m_boundary.size()) == 0)) {
14841484
char *boundary_end = m_buf + 2 + m_boundary.size();
1485+
/* if it match, AND there was a matched boundary at least,
1486+
clear the m_flag_unmatched_boundary flag */
1487+
if (m_boundary_count > 0) {
1488+
m_flag_unmatched_boundary = 0;
1489+
}
14851490
int is_final = 0;
14861491

14871492
/* Is this the final boundary? */

0 commit comments

Comments
 (0)