summaryrefslogtreecommitdiffstats
path: root/src/web_service
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-04-17 03:12:33 +0200
committerGitHub <noreply@github.com>2020-04-17 03:12:33 +0200
commit79c1269f0fd25e8aaf090cd1f4640a52237a3fd3 (patch)
treecef3d04b0e14887bbcb6b021d42e2420ae1588a4 /src/web_service
parentMerge pull request #3600 from ReinUsesLisp/no-pointer-buf-cache (diff)
parentCMakeLists: Specify -Wextra on linux builds (diff)
downloadyuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.tar
yuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.tar.gz
yuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.tar.bz2
yuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.tar.lz
yuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.tar.xz
yuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.tar.zst
yuzu-79c1269f0fd25e8aaf090cd1f4640a52237a3fd3.zip
Diffstat (limited to 'src/web_service')
-rw-r--r--src/web_service/web_backend.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp
index 737ffe409..09d1651ac 100644
--- a/src/web_service/web_backend.cpp
+++ b/src/web_service/web_backend.cpp
@@ -43,7 +43,7 @@ struct Client::Impl {
if (jwt.empty() && !allow_anonymous) {
LOG_ERROR(WebService, "Credentials must be provided for authenticated requests");
return Common::WebResult{Common::WebResult::Code::CredentialsMissing,
- "Credentials needed"};
+ "Credentials needed", ""};
}
auto result = GenericRequest(method, path, data, accept, jwt);
@@ -81,12 +81,12 @@ struct Client::Impl {
cli = std::make_unique<httplib::SSLClient>(parsedUrl.m_Host.c_str(), port);
} else {
LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme);
- return Common::WebResult{Common::WebResult::Code::InvalidURL, "Bad URL scheme"};
+ return Common::WebResult{Common::WebResult::Code::InvalidURL, "Bad URL scheme", ""};
}
}
if (cli == nullptr) {
LOG_ERROR(WebService, "Invalid URL {}", host + path);
- return Common::WebResult{Common::WebResult::Code::InvalidURL, "Invalid URL"};
+ return Common::WebResult{Common::WebResult::Code::InvalidURL, "Invalid URL", ""};
}
cli->set_timeout_sec(TIMEOUT_SECONDS);
@@ -118,27 +118,27 @@ struct Client::Impl {
if (!cli->send(request, response)) {
LOG_ERROR(WebService, "{} to {} returned null", method, host + path);
- return Common::WebResult{Common::WebResult::Code::LibError, "Null response"};
+ return Common::WebResult{Common::WebResult::Code::LibError, "Null response", ""};
}
if (response.status >= 400) {
LOG_ERROR(WebService, "{} to {} returned error status code: {}", method, host + path,
response.status);
return Common::WebResult{Common::WebResult::Code::HttpError,
- std::to_string(response.status)};
+ std::to_string(response.status), ""};
}
auto content_type = response.headers.find("content-type");
if (content_type == response.headers.end()) {
LOG_ERROR(WebService, "{} to {} returned no content", method, host + path);
- return Common::WebResult{Common::WebResult::Code::WrongContent, ""};
+ return Common::WebResult{Common::WebResult::Code::WrongContent, "", ""};
}
if (content_type->second.find(accept) == std::string::npos) {
LOG_ERROR(WebService, "{} to {} returned wrong content: {}", method, host + path,
content_type->second);
- return Common::WebResult{Common::WebResult::Code::WrongContent, "Wrong content"};
+ return Common::WebResult{Common::WebResult::Code::WrongContent, "Wrong content", ""};
}
return Common::WebResult{Common::WebResult::Code::Success, "", response.body};
}