From f6a2365ca58ba43e9700b370d19ad06e04ac8205 Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 6 Dec 2019 12:21:15 -0500 Subject: [PATCH] Fix #282 --- httplib.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/httplib.h b/httplib.h index 6e12e3a..dc04f88 100644 --- a/httplib.h +++ b/httplib.h @@ -2078,17 +2078,15 @@ public: 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;