Allow `MultiPartParser` to parse PATCH requests (#2062)
This commit is contained in:
parent
8bdb9b2fa6
commit
de5a4a5f57
|
@ -52,8 +52,16 @@ const SafeStringMap<std::string> &MultiPartParser::getParameters() const
|
|||
|
||||
int MultiPartParser::parse(const HttpRequestPtr &req)
|
||||
{
|
||||
if (req->method() != Post && req->method() != Put)
|
||||
return -1;
|
||||
switch (req->method())
|
||||
{
|
||||
case Post:
|
||||
case Put:
|
||||
case Patch:
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
|
||||
const std::string &contentType =
|
||||
static_cast<HttpRequestImpl *>(req.get())->getHeaderBy("content-type");
|
||||
if (contentType.empty())
|
||||
|
|
Loading…
Reference in New Issue