1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Fix uninitialized variable in Http.h

This commit is contained in:
ZehMatt
2021-07-30 02:19:18 +03:00
parent b992951bb2
commit aeb68008fa

View File

@@ -22,6 +22,7 @@ namespace Http
{
enum class Status
{
Invalid = 0,
Ok = 200,
NotFound = 404
};
@@ -35,20 +36,20 @@ namespace Http
struct Response
{
Status status;
Status status{};
std::string content_type;
std::string body = "";
std::string body;
std::map<std::string, std::string> header = {};
std::string error = "";
std::string error;
};
struct Request
{
std::string url;
std::map<std::string, std::string> header = {};
std::map<std::string, std::string> header;
Method method = Method::GET;
std::string body = "";
bool forceIPv4 = false;
std::string body;
bool forceIPv4{};
};
Response Do(const Request& req);
@@ -56,7 +57,7 @@ namespace Http
inline void DoAsync(const Request& req, std::function<void(Response& res)> fn)
{
auto thread = std::thread([=]() {
Response res;
Response res{};
try
{
res = Do(req);