diff OrthancServer/OrthancHttpHandler.cpp @ 1445:d26c8a93d05a

refactoring: SimpleGet
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 12:30:19 +0200
parents 895ab369d63c
children 8dc80ba768aa
line wrap: on
line diff
--- a/OrthancServer/OrthancHttpHandler.cpp	Wed Jul 01 12:09:58 2015 +0200
+++ b/OrthancServer/OrthancHttpHandler.cpp	Wed Jul 01 12:30:19 2015 +0200
@@ -69,13 +69,20 @@
   }
 
 
-  IHttpHandler& OrthancHttpHandler::GetOrthancRestApi() const
+  IHttpHandler& OrthancHttpHandler::RestrictToOrthancRestApi(bool restrict)
   {
-    if (orthancRestApi_ == NULL)
+    if (restrict)
     {
-      throw OrthancException(ErrorCode_InternalError);
+      if (orthancRestApi_ == NULL)
+      {
+        throw OrthancException(ErrorCode_InternalError);
+      }
+
+      return *orthancRestApi_;
     }
-
-    return *orthancRestApi_;
+    else
+    {
+      return *this;
+    }
   }
 }