Vote count: 0
I am trying to implement a simple HTTP server in C++ and wasn't too sure how to handle a GET request with a URI that navigates outside of the server's given root directory.
For example, if my root directory was: ~public/www/ and someone attempted to do a GET /../../somefile.html HTTP/1.1 , is there a way to compare the file paths of the root directory and the request uri to make sure that the request uri is always at the root level or lower?
asked 32 secs ago
How to compare the levels of a path?
Aucun commentaire:
Enregistrer un commentaire