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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user