#ifndef HTTP_STATUS_HPP # define HTTP_STATUS_HPP // https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml /* First version of macro HTML_ERROR(STATUS) dont work with call like this : client->response.append( HTML_ERROR( _http_status[client->status].c_str() ) ); so I made the other version with dynamic replacement of STATUS . */ // # define HTML_ERROR(STATUS) "\r\n
Le Webserv/0.1
" # define STATUS_PLACEHOLDER "$STATUS" # define HTML_ERROR \ ""\ ""\ ""\ "Le Webserv/0.1
"\ ""\ "" // When new status added, need to update _init_http_status_map() # define S200 "200 OK" # define S201 "201 Created" # define S204 "204 No Content" # define S400 "400 Bad Request" # define S403 "403 Forbidden" # define S404 "404 Not Found" # define S405 "405 Method Not Allowed" # define S413 "413 Content Too Large" # define S500 "500 Internal Server Error" # define S501 "501 Not Implemented" #endif