diff OrthancServer/Sources/LuaScripting.cpp @ 4329:9dc0e42f868b

moving static methods from HttpToolbox to IHttpHandler
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Nov 2020 13:46:49 +0100
parents 318c16cfccab
children d9473bd5ed43
line wrap: on
line diff
--- a/OrthancServer/Sources/LuaScripting.cpp	Wed Nov 25 13:34:58 2020 +0100
+++ b/OrthancServer/Sources/LuaScripting.cpp	Wed Nov 25 13:46:49 2020 +0100
@@ -405,8 +405,8 @@
     try
     {
       std::string result;
-      if (HttpToolbox::SimpleGet(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
-                                 RequestOrigin_Lua, uri, headers))
+      if (IHttpHandler::SimpleGet(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
+                                  RequestOrigin_Lua, uri, headers))
       {
         lua_pushlstring(state, result.c_str(), result.size());
         return 1;
@@ -458,10 +458,10 @@
     {
       std::string result;
       if (isPost ?
-          HttpToolbox::SimplePost(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
-                                  RequestOrigin_Lua, uri, bodyData, bodySize, headers) :
-          HttpToolbox::SimplePut(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
-                                 RequestOrigin_Lua, uri, bodyData, bodySize, headers))
+          IHttpHandler::SimplePost(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
+                                   RequestOrigin_Lua, uri, bodyData, bodySize, headers) :
+          IHttpHandler::SimplePut(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
+                                  RequestOrigin_Lua, uri, bodyData, bodySize, headers))
       {
         lua_pushlstring(state, result.c_str(), result.size());
         return 1;
@@ -522,8 +522,8 @@
     
     try
     {
-      if (HttpToolbox::SimpleDelete(serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
-                                    RequestOrigin_Lua, uri, headers))
+      if (IHttpHandler::SimpleDelete(serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), 
+                                     RequestOrigin_Lua, uri, headers))
       {
         lua_pushboolean(state, 1);
         return 1;