Exit with error code 1 if request is bad
This commit is contained in:
parent
1aca78df88
commit
06a1bfccd9
@ -29,14 +29,14 @@ const Request http::parse_request(const string &request)
|
||||
if (request.substr(0, 8) == "/favicon")
|
||||
{
|
||||
cout << "Status: 404 Not Found\n\n";
|
||||
std::exit(0);
|
||||
std::exit(1);
|
||||
}
|
||||
if (request.substr(0, 8) != "/avatar/" ||
|
||||
request.find("..", 8) != std::string::npos)
|
||||
{
|
||||
cout << "Status: 400 Bad Request\n\n";
|
||||
cerr << "Error: Invalid URL.\n";
|
||||
std::exit(0);
|
||||
std::exit(1);
|
||||
}
|
||||
|
||||
uint16_t size = 80;
|
||||
|
Loading…
x
Reference in New Issue
Block a user