diff options
| author | 2020-02-18 17:14:03 -0800 | |
|---|---|---|
| committer | 2020-02-18 18:04:33 -0800 | |
| commit | ad4e5c15fb5779309cc086045e8656254dd1e782 (patch) | |
| tree | b7971047928675b71cf0b0ca665dc0acb98de823 /src/web_service/web_backend.cpp | |
| parent | update httplib to latest commit (diff) | |
| download | yuzu-ad4e5c15fb5779309cc086045e8656254dd1e782.tar.gz yuzu-ad4e5c15fb5779309cc086045e8656254dd1e782.tar.xz yuzu-ad4e5c15fb5779309cc086045e8656254dd1e782.zip | |
httplib compatibility
Diffstat (limited to 'src/web_service/web_backend.cpp')
| -rw-r--r-- | src/web_service/web_backend.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 6683f459f..737ffe409 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -73,14 +73,12 @@ struct Client::Impl { | |||
| 73 | if (!parsedUrl.GetPort(&port)) { | 73 | if (!parsedUrl.GetPort(&port)) { |
| 74 | port = HTTP_PORT; | 74 | port = HTTP_PORT; |
| 75 | } | 75 | } |
| 76 | cli = std::make_unique<httplib::Client>(parsedUrl.m_Host.c_str(), port, | 76 | cli = std::make_unique<httplib::Client>(parsedUrl.m_Host.c_str(), port); |
| 77 | TIMEOUT_SECONDS); | ||
| 78 | } else if (parsedUrl.m_Scheme == "https") { | 77 | } else if (parsedUrl.m_Scheme == "https") { |
| 79 | if (!parsedUrl.GetPort(&port)) { | 78 | if (!parsedUrl.GetPort(&port)) { |
| 80 | port = HTTPS_PORT; | 79 | port = HTTPS_PORT; |
| 81 | } | 80 | } |
| 82 | cli = std::make_unique<httplib::SSLClient>(parsedUrl.m_Host.c_str(), port, | 81 | cli = std::make_unique<httplib::SSLClient>(parsedUrl.m_Host.c_str(), port); |
| 83 | TIMEOUT_SECONDS); | ||
| 84 | } else { | 82 | } else { |
| 85 | LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme); | 83 | LOG_ERROR(WebService, "Bad URL scheme {}", parsedUrl.m_Scheme); |
| 86 | return Common::WebResult{Common::WebResult::Code::InvalidURL, "Bad URL scheme"}; | 84 | return Common::WebResult{Common::WebResult::Code::InvalidURL, "Bad URL scheme"}; |
| @@ -90,6 +88,7 @@ struct Client::Impl { | |||
| 90 | LOG_ERROR(WebService, "Invalid URL {}", host + path); | 88 | LOG_ERROR(WebService, "Invalid URL {}", host + path); |
| 91 | return Common::WebResult{Common::WebResult::Code::InvalidURL, "Invalid URL"}; | 89 | return Common::WebResult{Common::WebResult::Code::InvalidURL, "Invalid URL"}; |
| 92 | } | 90 | } |
| 91 | cli->set_timeout_sec(TIMEOUT_SECONDS); | ||
| 93 | 92 | ||
| 94 | httplib::Headers params; | 93 | httplib::Headers params; |
| 95 | if (!jwt.empty()) { | 94 | if (!jwt.empty()) { |