mirror of
https://github.com/yhirose/cpp-httplib
synced 2024-11-21 14:29:10 -07:00
Fixed #527
This commit is contained in:
parent
29677540ae
commit
3e9c06cf79
1 changed files with 5 additions and 2 deletions
|
@ -2781,9 +2781,12 @@ inline bool parse_multipart_boundary(const std::string &content_type,
|
||||||
std::string &boundary) {
|
std::string &boundary) {
|
||||||
auto pos = content_type.find("boundary=");
|
auto pos = content_type.find("boundary=");
|
||||||
if (pos == std::string::npos) { return false; }
|
if (pos == std::string::npos) { return false; }
|
||||||
|
|
||||||
boundary = content_type.substr(pos + 9);
|
boundary = content_type.substr(pos + 9);
|
||||||
return true;
|
if (boundary.length() >= 2 && boundary.front() == '"' &&
|
||||||
|
boundary.back() == '"') {
|
||||||
|
boundary = boundary.substr(1, boundary.size() - 2);
|
||||||
|
}
|
||||||
|
return !boundary.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool parse_range_header(const std::string &s, Ranges &ranges) {
|
inline bool parse_range_header(const std::string &s, Ranges &ranges) {
|
||||||
|
|
Loading…
Reference in a new issue