diff OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp @ 5857:39996519afce find-refactoring

fix limit/since restrictions
author Alain Mazy <am@orthanc.team>
date Mon, 04 Nov 2024 22:06:45 +0100
parents d1dea8ad74a6
children
line wrap: on
line diff
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Mon Nov 04 21:51:24 2024 +0100
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp	Mon Nov 04 22:06:45 2024 +0100
@@ -3389,8 +3389,9 @@
 
         finder.SetDatabaseLimits(context.GetDatabaseLimits(level));
 
-        if ((request.isMember(KEY_LIMIT) || request.isMember(KEY_SINCE)) &&
-          !dicomTagLookup.HasOnlyMainDicomTags())
+        if (((request.isMember(KEY_LIMIT) && request[KEY_LIMIT].asInt64() != 0) || 
+             (request.isMember(KEY_SINCE) && request[KEY_SINCE].asInt64() != 0)) &&
+            !dicomTagLookup.HasOnlyMainDicomTags())
         {
             throw OrthancException(ErrorCode_BadRequest,
                                   "Unable to use " + std::string(KEY_LIMIT) + " or " + std::string(KEY_SINCE) + " in tools/find when querying tags that are not stored as MainDicomTags in the Database");