From dc28eae95a46c3079fcc76b3425ffa37844dd37d Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Thu, 11 Aug 2022 23:37:39 -0400 Subject: spoof a bunch of headers like the web client --- src/discord/httpclient.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/discord/httpclient.hpp') diff --git a/src/discord/httpclient.hpp b/src/discord/httpclient.hpp index 47b8a4d..841ce11 100644 --- a/src/discord/httpclient.hpp +++ b/src/discord/httpclient.hpp @@ -17,6 +17,8 @@ public: void SetUserAgent(std::string agent); void SetAuth(std::string auth); + void SetPersistentHeader(std::string name, std::string value); + void MakeDELETE(const std::string &path, const std::function &cb); void MakeGET(const std::string &path, const std::function &cb); void MakePATCH(const std::string &path, const std::string &payload, const std::function &cb); @@ -24,6 +26,8 @@ public: void MakePUT(const std::string &path, const std::string &payload, const std::function &cb); private: + void AddHeaders(http::request &r); + void OnResponse(const http::response_type &r, const std::function &cb); void CleanupFutures(); @@ -36,4 +40,5 @@ private: std::string m_api_base; std::string m_authorization; std::string m_agent; + std::unordered_map m_headers; }; -- cgit v1.2.3