diff OrthancServer/Sources/main.cpp @ 4243:64f57c9d5f79

configuration options for webdav
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 09 Oct 2020 18:10:24 +0200
parents 5cfa6ba75dfc
children 251a8b07fa37
line wrap: on
line diff
--- a/OrthancServer/Sources/main.cpp	Fri Oct 09 17:51:06 2020 +0200
+++ b/OrthancServer/Sources/main.cpp	Fri Oct 09 18:10:24 2020 +0200
@@ -1041,6 +1041,16 @@
         context.SetExecuteLuaEnabled(false);
         LOG(WARNING) << "Remote LUA script execution is disabled";
       }
+
+      if (lock.GetConfiguration().GetBooleanParameter("WebDavEnabled", true))
+      {
+        const bool allowDelete = lock.GetConfiguration().GetBooleanParameter("WebDavDeleteAllowed", false);
+        const bool allowUpload = lock.GetConfiguration().GetBooleanParameter("WebDavUploadAllowed", true);
+        
+        UriComponents root;
+        root.push_back("webdav");
+        httpServer.Register(root, new OrthancWebDav(context, allowDelete, allowUpload));
+      }
     }
 
     MyHttpExceptionFormatter exceptionFormatter(httpDescribeErrors, plugins);
@@ -1049,13 +1059,6 @@
     httpServer.SetHttpExceptionFormatter(exceptionFormatter);
     httpServer.Register(context.GetHttpHandler());
 
-    {
-      UriComponents root;  // TODO
-      root.push_back("a");
-      root.push_back("b");
-      httpServer.Register(root, new OrthancWebDav(context, true /* allow delete */));
-    }
-
     if (httpServer.GetPortNumber() < 1024)
     {
       LOG(WARNING) << "The HTTP port is privileged ("