diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-05-27 01:57:11 +0200 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-06-14 00:19:22 +0200 |
commit | 12156b199a13d7147f3fe6aebe72ae0c257986a5 (patch) | |
tree | cc315cb877b7555cb80c6f4322de8beb6bb12cdb /src/web_service | |
parent | Merge pull request #8446 from liamwhite/cmd-gdb (diff) | |
download | yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.gz yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.bz2 yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.lz yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.xz yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.zst yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/web_service/telemetry_json.cpp | 4 | ||||
-rw-r--r-- | src/web_service/web_backend.cpp | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp index 6215c914f..46faddb61 100644 --- a/src/web_service/telemetry_json.cpp +++ b/src/web_service/telemetry_json.cpp @@ -13,8 +13,8 @@ namespace WebService { namespace Telemetry = Common::Telemetry; struct TelemetryJson::Impl { - Impl(std::string host, std::string username, std::string token) - : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} {} + Impl(std::string host_, std::string username_, std::string token_) + : host{std::move(host_)}, username{std::move(username_)}, token{std::move(token_)} {} nlohmann::json& TopSection() { return sections[static_cast<u8>(Telemetry::FieldType::None)]; diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index 58b0c2f10..dce9772fe 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp @@ -30,10 +30,10 @@ constexpr std::array<const char, 1> API_VERSION{'1'}; constexpr std::size_t TIMEOUT_SECONDS = 30; struct Client::Impl { - Impl(std::string host, std::string username, std::string token) - : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { + Impl(std::string host_, std::string username_, std::string token_) + : host{std::move(host_)}, username{std::move(username_)}, token{std::move(token_)} { std::scoped_lock lock{jwt_cache.mutex}; - if (this->username == jwt_cache.username && this->token == jwt_cache.token) { + if (username == jwt_cache.username && token == jwt_cache.token) { jwt = jwt_cache.jwt; } } @@ -69,8 +69,8 @@ struct Client::Impl { */ WebResult GenericRequest(const std::string& method, const std::string& path, const std::string& data, const std::string& accept, - const std::string& jwt = "", const std::string& username = "", - const std::string& token = "") { + const std::string& jwt_ = "", const std::string& username_ = "", + const std::string& token_ = "") { if (cli == nullptr) { cli = std::make_unique<httplib::Client>(host.c_str()); } @@ -85,14 +85,14 @@ struct Client::Impl { cli->set_write_timeout(TIMEOUT_SECONDS); httplib::Headers params; - if (!jwt.empty()) { + if (!jwt_.empty()) { params = { - {std::string("Authorization"), fmt::format("Bearer {}", jwt)}, + {std::string("Authorization"), fmt::format("Bearer {}", jwt_)}, }; - } else if (!username.empty()) { + } else if (!username_.empty()) { params = { - {std::string("x-username"), username}, - {std::string("x-token"), token}, + {std::string("x-username"), username_}, + {std::string("x-token"), token_}, }; } |