Skip to content

Commit f6a2365

Browse files
committed
Fix #282
1 parent df1ff75 commit f6a2365

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

httplib.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2078,17 +2078,15 @@ class MultipartFormDataParser {
20782078
break;
20792079
}
20802080
case 4: { // Boundary
2081-
auto pos = buf_.find(crlf_);
20822081
if (crlf_.size() > buf_.size()) { return true; }
2083-
if (pos == 0) {
2082+
if (buf_.find(crlf_) == 0) {
20842083
buf_.erase(0, crlf_.size());
20852084
off_ += crlf_.size();
20862085
state_ = 1;
20872086
} else {
20882087
auto pattern = dash_ + crlf_;
20892088
if (pattern.size() > buf_.size()) { return true; }
2090-
auto pos = buf_.find(pattern);
2091-
if (pos == 0) {
2089+
if (buf_.find(pattern) == 0) {
20922090
buf_.erase(0, pattern.size());
20932091
off_ += pattern.size();
20942092
is_valid_ = true;

0 commit comments

Comments
 (0)