mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
* fix: skip MIME preamble (#1317) * Skip epilogue in multipart/form-data Co-authored-by: Gavin1937 <71205842+Gavin1937@users.noreply.github.com>
This commit is contained in:
parent
caa31aafda
commit
127a64d5a0
2 changed files with 54 additions and 9 deletions
|
@ -3794,6 +3794,7 @@ public:
|
|||
switch (state_) {
|
||||
case 0: { // Initial boundary
|
||||
auto pattern = dash_ + boundary_ + crlf_;
|
||||
buf_erase(buf_find(pattern));
|
||||
if (pattern.size() > buf_size()) { return true; }
|
||||
if (!buf_start_with(pattern)) { return false; }
|
||||
buf_erase(pattern.size());
|
||||
|
@ -3887,17 +3888,13 @@ public:
|
|||
if (buf_start_with(pattern)) {
|
||||
buf_erase(pattern.size());
|
||||
is_valid_ = true;
|
||||
state_ = 5;
|
||||
buf_erase(buf_size()); // Remove epilogue
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5: { // Done
|
||||
is_valid_ = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue