This commit is contained in:
2024-01-13 17:19:37 +08:00
parent b6db76625b
commit 841bcc3998
6 changed files with 36 additions and 0 deletions

View File

@@ -1028,3 +1028,18 @@ std::string dumpCookie(std::map<std::string, std::string> cookie) {
}
return re;
}
std::string Request::toUri() {
std::string re;
if (this->https) {
re += "https://";
} else {
re += "http://";
}
re += this->host;
if (this->port != (this->https ? "https" : "http")) {
re += ":" + this->port;
}
re += this->path;
return re;
}