diff Plugins/Engine/OrthancPlugins.cpp @ 3442:dd1e68f2d0c0

Fix issue #106 (Unable to export preview as jpeg from Lua script)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 24 Jun 2019 16:06:47 +0200
parents 954d15f24366
children 69e49fc044f8
line wrap: on
line diff
--- a/Plugins/Engine/OrthancPlugins.cpp	Mon Jun 24 12:37:52 2019 +0200
+++ b/Plugins/Engine/OrthancPlugins.cpp	Mon Jun 24 16:06:47 2019 +0200
@@ -1948,8 +1948,10 @@
       handler = &lock.GetContext().GetHttpHandler().RestrictToOrthancRestApi(!afterPlugins);
     }
 
+    std::map<std::string, std::string> httpHeaders;
+
     std::string result;
-    if (HttpToolbox::SimpleGet(result, *handler, RequestOrigin_Plugins, p.uri))
+    if (HttpToolbox::SimpleGet(result, *handler, RequestOrigin_Plugins, p.uri, httpHeaders))
     {
       CopyToMemoryBuffer(*p.target, result);
     }
@@ -2013,10 +2015,12 @@
       handler = &lock.GetContext().GetHttpHandler().RestrictToOrthancRestApi(!afterPlugins);
     }
       
+    std::map<std::string, std::string> httpHeaders;
+
     std::string result;
     if (isPost ? 
-        HttpToolbox::SimplePost(result, *handler, RequestOrigin_Plugins, p.uri, p.body, p.bodySize) :
-        HttpToolbox::SimplePut (result, *handler, RequestOrigin_Plugins, p.uri, p.body, p.bodySize))
+        HttpToolbox::SimplePost(result, *handler, RequestOrigin_Plugins, p.uri, p.body, p.bodySize, httpHeaders) :
+        HttpToolbox::SimplePut (result, *handler, RequestOrigin_Plugins, p.uri, p.body, p.bodySize, httpHeaders))
     {
       CopyToMemoryBuffer(*p.target, result);
     }
@@ -2041,7 +2045,9 @@
       handler = &lock.GetContext().GetHttpHandler().RestrictToOrthancRestApi(!afterPlugins);
     }
       
-    if (!HttpToolbox::SimpleDelete(*handler, RequestOrigin_Plugins, uri))
+    std::map<std::string, std::string> httpHeaders;
+
+    if (!HttpToolbox::SimpleDelete(*handler, RequestOrigin_Plugins, uri, httpHeaders))
     {
       throw OrthancException(ErrorCode_UnknownResource);
     }