Redirects URI
This commit is contained in:
@ -47,7 +47,7 @@ URI::URI(string webroot, string reqpath) {
|
|||||||
query = "";
|
query = "";
|
||||||
queryinit = false;
|
queryinit = false;
|
||||||
}
|
}
|
||||||
if (webroot[webroot.length() - 1] == '/') {
|
if (webroot.length() >= 1 && webroot[webroot.length() - 1] == '/') {
|
||||||
webroot.erase(webroot.length() - 1);
|
webroot.erase(webroot.length() - 1);
|
||||||
}
|
}
|
||||||
reqpath = url_decode(reqpath);
|
reqpath = url_decode(reqpath);
|
||||||
|
@ -200,7 +200,7 @@ bool connection_handler(const char *preprefix, const char *col1, const char *col
|
|||||||
req.redirect(303, "https://www.necronda.net/");
|
req.redirect(303, "https://www.necronda.net/");
|
||||||
} else if (socket->getSocketPort() != 443) {
|
} else if (socket->getSocketPort() != 443) {
|
||||||
req.redirect(303, "https://" + host + req.getPath());
|
req.redirect(303, "https://" + host + req.getPath());
|
||||||
} else if (getWebRoot(host) == "") {
|
} else if (getWebRoot(host).empty()) {
|
||||||
req.redirect(303, "https://www.necronda.net" + req.getPath());
|
req.redirect(303, "https://www.necronda.net" + req.getPath());
|
||||||
} else {
|
} else {
|
||||||
redir = false;
|
redir = false;
|
||||||
|
Reference in New Issue
Block a user