trying to get submit form to work...
This commit is contained in:
@@ -52,6 +52,8 @@ int Webserv::_read_request(Client *client)
|
||||
}
|
||||
client->raw_request.append(buf, ret);
|
||||
|
||||
print_special(client->raw_request);
|
||||
|
||||
if (!client->header_complete)
|
||||
{
|
||||
client->parse_request_headers(_servers);
|
||||
|
||||
@@ -199,17 +199,17 @@ If we get a url that ends in / ignore the last /
|
||||
*/
|
||||
|
||||
std::string uri = path;
|
||||
if (uri[uri.size() - 1] == '/')
|
||||
if (uri[uri.size() - 1] == '/' && uri.size() != 1)
|
||||
uri.erase(uri.size() - 1);
|
||||
|
||||
|
||||
for (std::vector<LocationConfig>::const_iterator it = server.locations.begin(); it != server.locations.end(); it++)
|
||||
{
|
||||
std::cout << it->path << " -- ";
|
||||
// std::cout << it->path << " -- ";
|
||||
|
||||
if (it->path.size() > uri.size())
|
||||
{
|
||||
std::cout << "skipping this one\n";
|
||||
// std::cout << "skipping this one\n";
|
||||
continue ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user