Skip to content

Commit

Permalink
Fix #282
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Dec 6, 2019
1 parent df1ff75 commit f6a2365
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions httplib.h
Original file line number Diff line number Diff line change
Expand Up @@ -2078,17 +2078,15 @@ class MultipartFormDataParser {
break;
}
case 4: { // Boundary
auto pos = buf_.find(crlf_);
if (crlf_.size() > buf_.size()) { return true; }
if (pos == 0) {
if (buf_.find(crlf_) == 0) {
buf_.erase(0, crlf_.size());
off_ += crlf_.size();
state_ = 1;
} else {
auto pattern = dash_ + crlf_;
if (pattern.size() > buf_.size()) { return true; }
auto pos = buf_.find(pattern);
if (pos == 0) {
if (buf_.find(pattern) == 0) {
buf_.erase(0, pattern.size());
off_ += pattern.size();
is_valid_ = true;
Expand Down

0 comments on commit f6a2365

Please sign in to comment.