diff options
| author | 2024-02-06 15:48:04 +0100 | |
|---|---|---|
| committer | 2024-02-06 15:48:04 +0100 | |
| commit | c0a383d9601178c5be8a3128c9cd7155001dcf4d (patch) | |
| tree | 166fceed5be9033b4a24f6bd51172d0f53c094ed | |
| parent | citra_qt/configure_ui: Show country of language in the combobox (diff) | |
| download | yuzu-c0a383d9601178c5be8a3128c9cd7155001dcf4d.tar.gz yuzu-c0a383d9601178c5be8a3128c9cd7155001dcf4d.tar.xz yuzu-c0a383d9601178c5be8a3128c9cd7155001dcf4d.zip | |
web_backend: Fix compilation
| -rw-r--r-- | src/web_service/web_backend.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index f41d8af0e..fdf3ac846 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -52,7 +52,7 @@ struct Client::Impl { | |||
| 52 | 52 | ||
| 53 | if (jwt.empty() && !allow_anonymous) { | 53 | if (jwt.empty() && !allow_anonymous) { |
| 54 | LOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); | 54 | LOG_ERROR(WebService, "Credentials must be provided for authenticated requests"); |
| 55 | return WebResult{WebResult::Code::CredentialsMissing, "Credentials needed"}; | 55 | return WebResult{WebResult::Code::CredentialsMissing, "Credentials needed", ""}; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | auto result = GenericRequest(method, path, data, accept, jwt); | 58 | auto result = GenericRequest(method, path, data, accept, jwt); |
| @@ -83,7 +83,7 @@ struct Client::Impl { | |||
| 83 | } | 83 | } |
| 84 | if (!cli->is_valid()) { | 84 | if (!cli->is_valid()) { |
| 85 | LOG_ERROR(WebService, "Invalid URL {}", host + path); | 85 | LOG_ERROR(WebService, "Invalid URL {}", host + path); |
| 86 | return WebResult{WebResult::Code::InvalidURL, "Invalid URL"}; | 86 | return WebResult{WebResult::Code::InvalidURL, "Invalid URL", ""}; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | httplib::Headers params; | 89 | httplib::Headers params; |
| @@ -114,7 +114,7 @@ struct Client::Impl { | |||
| 114 | 114 | ||
| 115 | if (!result) { | 115 | if (!result) { |
| 116 | LOG_ERROR(WebService, "{} to {} returned null", method, host + path); | 116 | LOG_ERROR(WebService, "{} to {} returned null", method, host + path); |
| 117 | return WebResult{WebResult::Code::LibError, "Null response"}; | 117 | return WebResult{WebResult::Code::LibError, "Null response", ""}; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | httplib::Response response = result.value(); | 120 | httplib::Response response = result.value(); |
| @@ -122,20 +122,20 @@ struct Client::Impl { | |||
| 122 | if (response.status >= 400) { | 122 | if (response.status >= 400) { |
| 123 | LOG_ERROR(WebService, "{} to {} returned error status code: {}", method, host + path, | 123 | LOG_ERROR(WebService, "{} to {} returned error status code: {}", method, host + path, |
| 124 | response.status); | 124 | response.status); |
| 125 | return WebResult{WebResult::Code::HttpError, std::to_string(response.status)}; | 125 | return WebResult{WebResult::Code::HttpError, std::to_string(response.status), ""}; |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | auto content_type = response.headers.find("content-type"); | 128 | auto content_type = response.headers.find("content-type"); |
| 129 | 129 | ||
| 130 | if (content_type == response.headers.end()) { | 130 | if (content_type == response.headers.end()) { |
| 131 | LOG_ERROR(WebService, "{} to {} returned no content", method, host + path); | 131 | LOG_ERROR(WebService, "{} to {} returned no content", method, host + path); |
| 132 | return WebResult{WebResult::Code::WrongContent, ""}; | 132 | return WebResult{WebResult::Code::WrongContent, "", ""}; |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | if (content_type->second.find(accept) == std::string::npos) { | 135 | if (content_type->second.find(accept) == std::string::npos) { |
| 136 | LOG_ERROR(WebService, "{} to {} returned wrong content: {}", method, host + path, | 136 | LOG_ERROR(WebService, "{} to {} returned wrong content: {}", method, host + path, |
| 137 | content_type->second); | 137 | content_type->second); |
| 138 | return WebResult{WebResult::Code::WrongContent, "Wrong content"}; | 138 | return WebResult{WebResult::Code::WrongContent, "Wrong content", ""}; |
| 139 | } | 139 | } |
| 140 | return WebResult{WebResult::Code::Success, "", response.body}; | 140 | return WebResult{WebResult::Code::Success, "", response.body}; |
| 141 | } | 141 | } |