# HG changeset patch # User Sebastien Jodogne # Date 1606243390 -3600 # Node ID 83c5bd439fcc1866ef8b0b98fdb067ef2796f080 # Parent b96aedfa8cc18adfe25bd6f18667c637589a1c7d fix for stone diff -r b96aedfa8cc1 -r 83c5bd439fcc OrthancFramework/Sources/HttpServer/HttpToolbox.cpp --- a/OrthancFramework/Sources/HttpServer/HttpToolbox.cpp Tue Nov 24 16:21:29 2020 +0100 +++ b/OrthancFramework/Sources/HttpServer/HttpToolbox.cpp Tue Nov 24 19:43:10 2020 +0100 @@ -188,6 +188,7 @@ } +#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimpleGet(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -212,8 +213,10 @@ return false; } } +#endif +#if ORTHANC_SANDBOXED != 1 static bool SimplePostOrPut(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -242,8 +245,10 @@ return false; } } +#endif +#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimplePost(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -254,8 +259,10 @@ { return SimplePostOrPut(result, handler, origin, HttpMethod_Post, uri, bodyData, bodySize, httpHeaders); } +#endif +#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimplePut(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -266,8 +273,10 @@ { return SimplePostOrPut(result, handler, origin, HttpMethod_Put, uri, bodyData, bodySize, httpHeaders); } +#endif + - +#if ORTHANC_SANDBOXED != 1 bool HttpToolbox::SimpleDelete(IHttpHandler& handler, RequestOrigin origin, const std::string& uri, @@ -284,4 +293,5 @@ return handler.Handle(http, origin, LOCALHOST, "", HttpMethod_Delete, curi, httpHeaders, getArguments, NULL /* no body for DELETE */, 0); } +#endif } diff -r b96aedfa8cc1 -r 83c5bd439fcc OrthancFramework/Sources/HttpServer/HttpToolbox.h --- a/OrthancFramework/Sources/HttpServer/HttpToolbox.h Tue Nov 24 16:21:29 2020 +0100 +++ b/OrthancFramework/Sources/HttpServer/HttpToolbox.h Tue Nov 24 19:43:10 2020 +0100 @@ -22,6 +22,10 @@ #pragma once +#if !defined(ORTHANC_SANDBOXED) +# error Macro ORTHANC_SANDBOXED must be defined +#endif + #include "../OrthancFramework.h" #include "IHttpHandler.h" @@ -51,6 +55,7 @@ static void CompileGetArguments(IHttpHandler::Arguments& compiled, const IHttpHandler::GetArguments& source); +#if ORTHANC_SANDBOXED != 1 static bool SimpleGet(std::string& result, IHttpHandler& handler, RequestOrigin origin, @@ -77,5 +82,6 @@ RequestOrigin origin, const std::string& uri, const IHttpHandler::Arguments& httpHeaders); +#endif }; } diff -r b96aedfa8cc1 -r 83c5bd439fcc OrthancFramework/UnitTestsSources/RestApiTests.cpp --- a/OrthancFramework/UnitTestsSources/RestApiTests.cpp Tue Nov 24 16:21:29 2020 +0100 +++ b/OrthancFramework/UnitTestsSources/RestApiTests.cpp Tue Nov 24 19:43:10 2020 +0100 @@ -208,6 +208,7 @@ ASSERT_EQ("v", cookies["n"]); } + TEST(RestApi, RestApiPath) { IHttpHandler::Arguments args; diff -r b96aedfa8cc1 -r 83c5bd439fcc OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Tue Nov 24 16:21:29 2020 +0100 +++ b/OrthancServer/Resources/RunCppCheck.sh Tue Nov 24 19:43:10 2020 +0100 @@ -12,7 +12,7 @@ constParameter:../../OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp knownArgument:../../OrthancFramework/UnitTestsSources/ImageTests.cpp knownConditionTrueFalse:../../OrthancServer/Plugins/Engine/OrthancPlugins.cpp -nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:309 +nullPointer:../../OrthancFramework/UnitTestsSources/RestApiTests.cpp:314 nullPointerRedundantCheck:../../OrthancFramework/UnitTestsSources/DicomMapTests.cpp stlFindInsert:../../OrthancFramework/Sources/DicomFormat/DicomMap.cpp:1163 stlFindInsert:../../OrthancServer/Sources/OrthancWebDav.cpp:383