Mercurial > hg > orthanc-object-storage
changeset 31:67a7102d8d0f
displays an error if RootPath starts with a '/'. S3 plugin was not able to read the file back.
author | Alain Mazy |
---|---|
date | Fri, 09 Oct 2020 10:15:21 +0200 |
parents | 968eb1c78aed |
children | 8d2b29fd4de5 |
files | Common/StoragePlugin.cpp |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Common/StoragePlugin.cpp Mon Sep 07 14:12:49 2020 +0200 +++ b/Common/StoragePlugin.cpp Fri Oct 09 10:15:21 2020 +0200 @@ -325,6 +325,13 @@ } objectsRootPath = pluginSection.GetStringValue("RootPath", std::string()); + + if (objectsRootPath.size() >= 1 && objectsRootPath[0] == '/') + { + OrthancPlugins::LogError(std::string(StoragePluginFactory::GetStoragePluginName()) + ": The RootPath shall not start with a '/': " + objectsRootPath); + return -1; + } + plugin->SetRootPath(objectsRootPath); if (pluginSection.IsSection(ENCRYPTION_SECTION))