diff --git a/srcs/cgi-bin/php-cgi b/srcs/cgi-bin/php-cgi index 6c90e0c..fa20b65 100755 --- a/srcs/cgi-bin/php-cgi +++ b/srcs/cgi-bin/php-cgi @@ -1,5 +1,4 @@ #! /usr/bin/php - - diff --git a/srcs/webserv/cgi_script.cpp b/srcs/webserv/cgi_script.cpp index 45b333b..1b9fee4 100644 --- a/srcs/webserv/cgi_script.cpp +++ b/srcs/webserv/cgi_script.cpp @@ -139,6 +139,9 @@ void Webserv::_check_script_output(Client *client, std::string & output) { _check_script_status(client, output); _check_script_fields(client, output); + // _check_script_empty_lines(client, output); + // _check_script_space_colons(client, output); + // _check_script_new_lines(client, output); } void Webserv::_check_script_status(Client *client, std::string & output) @@ -179,17 +182,6 @@ void Webserv::_check_script_fields(Client *client, std::string & output) tmp.erase(pos); ::parse_http_headers(tmp, scr_fld); // compare both map to supress duplicates - -// debug -std::map::iterator it; -std::cout << "\n\n+++++\ndebug comparison:\nBEFORE\nserver headers:\n"; -for (it = srv_fld.begin(); it != srv_fld.end(); it++) { - std::cout << " " << it->first << ": [" << it->second << "]\n"; } -std::cout << "\nscript headers:\n"; -for (it = scr_fld.begin(); it != scr_fld.end(); it++) { - std::cout << " " << it->first << ": [" << it->second << "]\n"; } -// en debug - for (it_srv = srv_fld.begin(); it_srv != srv_fld.end(); it_srv++) { for (it_scr = scr_fld.begin(); it_scr != scr_fld.end(); it_scr++) @@ -201,32 +193,5 @@ for (it = scr_fld.begin(); it != scr_fld.end(); it++) { } } } - -// debug - srv_fld.clear(); - scr_fld.clear(); - // put server headers in map - tmp = client->response; - pos = tmp.find(CRLF CRLF); - if (pos != std::string::npos) - tmp.erase(pos); - ::parse_http_headers(tmp, srv_fld); - // put script headers in map - tmp = output; - pos = tmp.find(CRLF CRLF); - if (pos != std::string::npos) - tmp.erase(pos); - ::parse_http_headers(tmp, scr_fld); - // compare both map to supress duplicates - -std::cout << "\nAFTER\nserver headers:\n"; -for (it = srv_fld.begin(); it != srv_fld.end(); it++) { - std::cout << " " << it->first << ": [" << it->second << "]\n"; } -std::cout << "\nscript headers:\n"; -for (it = scr_fld.begin(); it != scr_fld.end(); it++) { - std::cout << " " << it->first << ": [" << it->second << "]\n"; } -std::cout << "\nend debug comparison\n+++++\n\n"; -// end debug - }