Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Platforms/WebAssembly/WebAssemblyOracle.cpp @ 2161:e65fe2e50fde dicom-sr tip
integration mainline->dicom-sr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 27 Sep 2024 22:34:17 +0200 |
parents | 32bfccdc030f |
children |
comparison
equal
deleted
inserted
replaced
2152:f68f9a8d0d63 | 2161:e65fe2e50fde |
---|---|
27 // This is the case when using the WebAssembly side module, and this | 27 // This is the case when using the WebAssembly side module, and this |
28 // source file must be compiled within the WebAssembly main module | 28 // source file must be compiled within the WebAssembly main module |
29 # include <Oracle/WebAssemblyOracle_Includes.h> | 29 # include <Oracle/WebAssemblyOracle_Includes.h> |
30 #endif | 30 #endif |
31 | 31 |
32 #include "../../Toolbox/StoneToolbox.h" | |
33 | |
32 #include <OrthancException.h> | 34 #include <OrthancException.h> |
33 #include <Toolbox.h> | 35 #include <Toolbox.h> |
34 | 36 |
35 #include <emscripten.h> | 37 #include <emscripten.h> |
36 #include <emscripten/html5.h> | 38 #include <emscripten/html5.h> |
540 void WebAssemblyOracle::SetOrthancUrl(FetchCommand& command, | 542 void WebAssemblyOracle::SetOrthancUrl(FetchCommand& command, |
541 const std::string& uri) const | 543 const std::string& uri) const |
542 { | 544 { |
543 if (isLocalOrthanc_) | 545 if (isLocalOrthanc_) |
544 { | 546 { |
545 command.SetUrl(localOrthancRoot_ + uri); | 547 command.SetUrl(StoneToolbox::JoinUrl(localOrthancRoot_, uri)); |
546 } | 548 } |
547 else | 549 else |
548 { | 550 { |
549 command.SetUrl(remoteOrthanc_.GetUrl() + uri); | 551 command.SetUrl(StoneToolbox::JoinUrl(remoteOrthanc_.GetUrl(), uri)); |
550 command.AddHttpHeaders(remoteOrthanc_.GetHttpHeaders()); | 552 command.AddHttpHeaders(remoteOrthanc_.GetHttpHeaders()); |
551 | 553 |
552 if (!remoteOrthanc_.GetUsername().empty()) | 554 if (!remoteOrthanc_.GetUsername().empty()) |
553 { | 555 { |
554 command.SetCredentials(remoteOrthanc_.GetUsername(), remoteOrthanc_.GetPassword()); | 556 command.SetCredentials(remoteOrthanc_.GetUsername(), remoteOrthanc_.GetPassword()); |