diff --git a/Makefile b/Makefile index 5bd1b32..6b3e0eb 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ packages: @echo "Installing packages..." - sudo apt-get install g++ libmagic-dev libssl-dev + sudo apt-get install g++ libmagic-dev libssl-dev php-cgi @echo "Finished downloading!" compile: diff --git a/src/network/http/HttpConnection.cpp b/src/network/http/HttpConnection.cpp index 7b17604..fbbf47b 100644 --- a/src/network/http/HttpConnection.cpp +++ b/src/network/http/HttpConnection.cpp @@ -25,10 +25,15 @@ void HttpConnection::respond(int statuscode) { "

" + to_string(statuscode) + " " + ::getStatusCode(statuscode).message + "

" + - ((request->isExistingField("Host")) ? "

Go back to the home page of getField("Host") + "/\">" + - request->getField("Host") + - "

" : "") + "
\r\n" + ((request->isExistingField("Host")) ? + (request->isExistingField("Referer") && + request->getField("Referer").find(request->getField("Host")) != string::npos) ? + "

Go back to the last page you visited: getField("Referer") + "\">" + + request->getField("Referer") + "

" : + "

Go back to the home page of getField("Host") + "/\">" + + request->getField("Host") + + "

" : "") + "\r\n" ); } else { respond(statuscode, "");