Skip to content

Commit

Permalink
conditional body parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadit19 committed Sep 8, 2024
1 parent 88944f8 commit 3fe19b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ expresso::core::Server::makeRequest(std::string &request) noexcept(false) {
req.tempPath = req.tempPath.substr(0, req.tempPath.size() - 1);
}

if (req.method == expresso::enums::method::GET ||
req.method == expresso::enums::method::HEAD) {
return;
}

// Setting the body
std::string contentType = req.headers["content-type"];
std::string body = request.substr(request.find("\r\n\r\n") + 4);
Expand Down

0 comments on commit 3fe19b8

Please sign in to comment.