Skip to content

Commit

Permalink
fix(build)
Browse files Browse the repository at this point in the history
  • Loading branch information
hashimMH committed Jun 6, 2024
1 parent ee76df0 commit a0c890a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sources/CGI/Cgi.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Cgi.hpp"

CGI::CGI(const Request& request, const ServerConfig& cfg, CachedPages& cp)
: _body(request.get_body()), _cp(cp)
: _requestBody(request.get_body()), _cp(cp)
{
string resource = request.get_resource();
_filePath = resource;
Expand Down
6 changes: 3 additions & 3 deletions sources/http/handler/PostRequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ vector<char> PostRequestHandler::process_data(const Request& r)

if (requestBody.empty()) // no data to write
{
return make_error_body(BAD_REQUEST, cp);
return make_error_body(BAD_REQUEST);
}

if (resource.find("/cgi-bin") != string::npos) { //! cgi check again
CGI cgi(r, cfg, cp);
CGI cgi(r, cfg, *cp);
responseBody = cgi.execute(r.cgiStatus, r.cgiReadFd,
r.cgiChild); // ! r.fd set reference is kinda idk
// _add_header("Content-Length", ws_itoa(responseBody.size()));
Expand All @@ -40,7 +40,7 @@ vector<char> PostRequestHandler::process_data(const Request& r)
if (!outputFile.is_open()) // failed to open file
{
cout << "Failed to open file\n";
return make_error_body(INTERNAL_SERVER_ERROR, cp);
return make_error_body(INTERNAL_SERVER_ERROR);
}

// need to check if file is too big (return 413 if so)
Expand Down

0 comments on commit a0c890a

Please sign in to comment.