Changed invalid URL detection to support default image URLs
This commit is contained in:
parent
831b3c4ac0
commit
4da9a2144e
|
@ -26,7 +26,7 @@ using namespace http;
|
||||||
const Request http::parse_request(const string &request)
|
const Request http::parse_request(const string &request)
|
||||||
{
|
{
|
||||||
if (request.substr(0, 8) != "/avatar/" ||
|
if (request.substr(0, 8) != "/avatar/" ||
|
||||||
request.find('/', 8) != std::string::npos)
|
request.find("..", 8) != std::string::npos)
|
||||||
{
|
{
|
||||||
cout << "Status: 404 Not Found\n\n";
|
cout << "Status: 404 Not Found\n\n";
|
||||||
cerr << "Error: Invalid URL.\n";
|
cerr << "Error: Invalid URL.\n";
|
||||||
|
|
Loading…
Reference in New Issue