From 110fdc1157d94f5d787a21c60163681767fdd6c4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Jan 2024 13:13:23 +0300 Subject: more strict constructor of MHttpRequest to avoid quirks --- plugins/MirLua/src/Modules/m_http.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/MirLua') diff --git a/plugins/MirLua/src/Modules/m_http.cpp b/plugins/MirLua/src/Modules/m_http.cpp index fcc0365078..bbad6165fb 100644 --- a/plugins/MirLua/src/Modules/m_http.cpp +++ b/plugins/MirLua/src/Modules/m_http.cpp @@ -4,7 +4,7 @@ static MHttpRequest* CreateRequest() { - MHttpRequest *request = new MHttpRequest(); + MHttpRequest *request = new MHttpRequest(REQUEST_GET); request->flags = NLHRF_HTTP11 | NLHRF_NODUMP; return request; } @@ -269,9 +269,8 @@ static int request_Send(lua_State *L) { MHttpRequest *request = *(MHttpRequest**)luaL_checkudata(L, 1, MT_NETLIBHTTPREQUEST); - MHttpRequest *newRequest = new MHttpRequest(); + MHttpRequest *newRequest = new MHttpRequest(request->requestType); newRequest->flags = request->flags; - newRequest->requestType = request->requestType; newRequest->m_szUrl = request->m_szUrl; newRequest->m_szParam = request->m_szParam; newRequest->timeout = request->timeout; -- cgit v1.2.3