This commit is contained in:
sunsets
2023-06-26 18:20:40 +08:00
parent ea8bd92e15
commit d918a96f24
4 changed files with 80 additions and 54 deletions

View File

@@ -239,17 +239,18 @@ void Mainsail::set_auth(Http &http) const
if (!m_cafile.empty())
http.ca_file(m_cafile);
}
//B4
std::string Mainsail::make_url(const std::string &path) const
{
if (m_host.find("http://") == 0 || m_host.find("https://") == 0) {
if (m_host.back() == '/') {
return (boost::format("%1%%2%") % m_host % path).str();
std::string m_host_add = m_host + ":10088";
if (m_host_add.find("http://") == 0 || m_host_add.find("https://") == 0) {
if (m_host_add.back() == '/') {
return (boost::format("%1%%2%") % m_host_add % path).str();
} else {
return (boost::format("%1%/%2%") % m_host % path).str();
return (boost::format("%1%/%2%") % m_host_add % path).str();
}
} else {
return (boost::format("http://%1%/%2%") % m_host % path).str();
return (boost::format("http://%1%/%2%") % m_host_add % path).str();
}
}