Skip to content

Commit 3e9c06c

Browse files
committed
Fixed yhirose#527
1 parent 2967754 commit 3e9c06c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

httplib.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,9 +2781,12 @@ inline bool parse_multipart_boundary(const std::string &content_type,
27812781
std::string &boundary) {
27822782
auto pos = content_type.find("boundary=");
27832783
if (pos == std::string::npos) { return false; }
2784-
27852784
boundary = content_type.substr(pos + 9);
2786-
return true;
2785+
if (boundary.length() >= 2 && boundary.front() == '"' &&
2786+
boundary.back() == '"') {
2787+
boundary = boundary.substr(1, boundary.size() - 2);
2788+
}
2789+
return !boundary.empty();
27872790
}
27882791

27892792
inline bool parse_range_header(const std::string &s, Ranges &ranges) {

0 commit comments

Comments
 (0)