Skip to content

Commit 6f58dc7

Browse files
committed
Fixed problem with requests with no content
1 parent 905f2d8 commit 6f58dc7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

httplib.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2819,8 +2819,10 @@ inline bool Server::routing(Request &req, Response &res, Stream &strm, bool last
28192819
}
28202820

28212821
// Read content into `req.body`
2822-
if (!read_content(strm, last_connection, req, res)) {
2823-
return false;
2822+
if (req.method == "POST" || req.method == "PUT" || req.method == "PATCH" || req.method == "PRI") {
2823+
if (!read_content(strm, last_connection, req, res)) {
2824+
return false;
2825+
}
28242826
}
28252827

28262828
// Regular handler

0 commit comments

Comments
 (0)