diff Resources/Orthanc/Stone/OrthancHttpConnection.cpp @ 320:196d0e18afa0

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 Oct 2024 14:58:02 +0200
parents 0683312e21ba
children
line wrap: on
line diff
--- a/Resources/Orthanc/Stone/OrthancHttpConnection.cpp	Fri Sep 13 17:59:54 2024 +0200
+++ b/Resources/Orthanc/Stone/OrthancHttpConnection.cpp	Wed Oct 16 14:58:02 2024 +0200
@@ -3,7 +3,6 @@
  * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
  * Department, University Hospital of Liege, Belgium
  * Copyright (C) 2017-2023 Osimis S.A., Belgium
- * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
  * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
  *
  * This program is free software: you can redistribute it and/or
@@ -24,6 +23,8 @@
 
 #include "OrthancHttpConnection.h"
 
+#include "../StoneToolbox.h"
+
 namespace OrthancStone
 {
   void OrthancHttpConnection::Setup()
@@ -55,7 +56,7 @@
     boost::mutex::scoped_lock lock(mutex_);
 
     client_.SetMethod(Orthanc::HttpMethod_Get);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
     client_.ApplyAndThrowException(result);
   }
 
@@ -67,7 +68,7 @@
     boost::mutex::scoped_lock lock(mutex_);
 
     client_.SetMethod(Orthanc::HttpMethod_Post);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
 
 #if defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE) && ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 3)
     client_.SetExternalBody(body);
@@ -87,7 +88,7 @@
     boost::mutex::scoped_lock lock(mutex_);
 
     client_.SetMethod(Orthanc::HttpMethod_Put);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
 
 #if defined(ORTHANC_FRAMEWORK_VERSION_IS_ABOVE) && ORTHANC_FRAMEWORK_VERSION_IS_ABOVE(1, 9, 3)
     client_.SetExternalBody(body);
@@ -107,7 +108,7 @@
     std::string result;
 
     client_.SetMethod(Orthanc::HttpMethod_Delete);
-    client_.SetUrl(url_ + uri);
+    client_.SetUrl(StoneToolbox::JoinUrl(url_, uri));
     client_.ApplyAndThrowException(result);
   }
 }