mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Fixed problem with requests with no content
This commit is contained in:
parent
905f2d84f4
commit
6f58dc728f
1 changed files with 4 additions and 2 deletions
|
@ -2819,9 +2819,11 @@ inline bool Server::routing(Request &req, Response &res, Stream &strm, bool last
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read content into `req.body`
|
// Read content into `req.body`
|
||||||
|
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH" || req.method == "PRI") {
|
||||||
if (!read_content(strm, last_connection, req, res)) {
|
if (!read_content(strm, last_connection, req, res)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Regular handler
|
// Regular handler
|
||||||
if (req.method == "GET" || req.method == "HEAD") {
|
if (req.method == "GET" || req.method == "HEAD") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue