diff OrthancFramework/Sources/RestApi/RestApi.cpp @ 4400:029366f95217

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 23 Dec 2020 12:30:56 +0100
parents 80fd140b12ba
children 354ea95b294a
line wrap: on
line diff
--- a/OrthancFramework/Sources/RestApi/RestApi.cpp	Wed Dec 23 12:21:03 2020 +0100
+++ b/OrthancFramework/Sources/RestApi/RestApi.cpp	Wed Dec 23 12:30:56 2020 +0100
@@ -79,7 +79,7 @@
                          const HttpToolbox::Arguments& components,
                          const UriComponents& trailing)
       {
-        if (resource.HasMethod(method_))
+        if (resource.HasHandler(method_))
         {
           switch (method_)
           {
@@ -133,7 +133,7 @@
       Json::Value paths_;
   
     public:
-      OpenApiVisitor(RestApi& restApi) :
+      explicit OpenApiVisitor(RestApi& restApi) :
         restApi_(restApi)
       {
       }
@@ -146,18 +146,12 @@
       {
         const std::string path = Toolbox::FlattenUri(uri);
 
-        if (hasTrailing)
-          LOG(WARNING) << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> " << path;
-
         if (paths_.isMember(path))
         {
           throw OrthancException(ErrorCode_InternalError);
         }
 
-        //if (path == "/patients/{id}/protected")
-        //asm("int $3");
-
-        if (resource.HasMethod(HttpMethod_Get))
+        if (resource.HasHandler(HttpMethod_Get))
         {
           StringHttpOutput o1;
           HttpOutput o2(o1, false);
@@ -193,7 +187,7 @@
           }
         }
     
-        if (resource.HasMethod(HttpMethod_Post))
+        if (resource.HasHandler(HttpMethod_Post))
         {
           StringHttpOutput o1;
           HttpOutput o2(o1, false);
@@ -228,7 +222,7 @@
           }
         }
     
-        if (resource.HasMethod(HttpMethod_Delete))
+        if (resource.HasHandler(HttpMethod_Delete))
         {
           StringHttpOutput o1;
           HttpOutput o2(o1, false);
@@ -263,7 +257,7 @@
           }
         }
 
-        if (resource.HasMethod(HttpMethod_Put))
+        if (resource.HasHandler(HttpMethod_Put))
         {
           StringHttpOutput o1;
           HttpOutput o2(o1, false);