key fields headers in map are in lowercase
+ getters for this map are case insensitive + change request fiel 'path' for 'uri', 'query', and 'abs_path'
This commit is contained in:
@@ -72,7 +72,7 @@ void Webserv::_construct_response(Client *client, ServerConfig &server)
|
||||
client->status = 413;
|
||||
return;
|
||||
}
|
||||
LocationConfig &location = _determine_location(server, client->get_rq_path());
|
||||
LocationConfig &location = _determine_location(server, client->get_rq_uri());
|
||||
_process_method(client, server, location);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ void Webserv::_error_html_response(Client *client, ServerConfig &server)
|
||||
void Webserv::_get(Client *client, ServerConfig &server, LocationConfig &location)
|
||||
{
|
||||
(void)server; // To remove from arg if we determine its useless
|
||||
std::string path = client->get_rq_path();
|
||||
std::string path = client->get_rq_uri();
|
||||
|
||||
if (path == "/") // TODO : index and autoindex
|
||||
path.append(INDEX);
|
||||
@@ -255,7 +255,7 @@ void Webserv::_post(Client *client, ServerConfig &server, LocationConfig &locati
|
||||
WIP
|
||||
https://www.rfc-editor.org/rfc/rfc9110.html#name-post
|
||||
*/
|
||||
std::string path = client->get_rq_path();
|
||||
std::string path = client->get_rq_uri();
|
||||
path.insert(0, location.root);
|
||||
|
||||
/* CGI Here ? */
|
||||
@@ -321,7 +321,7 @@ void Webserv::_delete(Client *client, ServerConfig &server, LocationConfig &loca
|
||||
WIP
|
||||
https://www.rfc-editor.org/rfc/rfc9110.html#name-delete
|
||||
*/
|
||||
std::string path = client->get_rq_path();
|
||||
std::string path = client->get_rq_uri();
|
||||
path.insert(0, location.root);
|
||||
|
||||
/* CGI Here ? */
|
||||
|
||||
Reference in New Issue
Block a user