diff OrthancServer/LuaScripting.cpp @ 1445:d26c8a93d05a

refactoring: SimpleGet
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 12:30:19 +0200
parents b2b09a3dbd8e
children 5ba7471780ae
line wrap: on
line diff
--- a/OrthancServer/LuaScripting.cpp	Wed Jul 01 12:09:58 2015 +0200
+++ b/OrthancServer/LuaScripting.cpp	Wed Jul 01 12:30:19 2015 +0200
@@ -82,14 +82,10 @@
     const char* uri = lua_tostring(state, 1);
     bool builtin = (nArgs == 2 ? lua_toboolean(state, 2) : false);
 
-    IHttpHandler& handler = (builtin ? 
-                             serverContext->GetHttpHandler().GetOrthancRestApi() : 
-                             serverContext->GetHttpHandler());
-    
-    std::string str;
-    if (HttpToolbox::SimpleGet(str, handler, uri))
+    std::string result;
+    if (HttpToolbox::SimpleGet(result, serverContext->GetHttpHandler().RestrictToOrthancRestApi(builtin), uri))
     {
-      lua_pushstring(state, str.c_str());
+      lua_pushstring(state, result.c_str());
     }
     else
     {