mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-29 18:27:43 +08:00
Fix multipart boundary with charset (#1511)
For example Content-Type: multipart/form-data; boundary=TqmguJb_Fm_eFtAFCpWvmk5iPqrIEJJjvBFn; charset=ISO-8859-1
This commit is contained in:
parent
54d96963f3
commit
29955becc1
@ -71,9 +71,10 @@ int MultiPartParser::parse(const HttpRequestPtr &req)
|
||||
pos = contentType.find("boundary=");
|
||||
if (pos == std::string::npos)
|
||||
return -1;
|
||||
return parse(req,
|
||||
contentType.data() + (pos + 9),
|
||||
contentType.size() - (pos + 9));
|
||||
auto pos2 = contentType.find(';', pos);
|
||||
if (pos2 == std::string::npos)
|
||||
pos2 = contentType.size();
|
||||
return parse(req, contentType.data() + (pos + 9), pos2 - (pos + 9));
|
||||
}
|
||||
static std::pair<string_view, string_view> parseLine(const char *begin,
|
||||
const char *end)
|
||||
|
Loading…
Reference in New Issue
Block a user