diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/storage/objectstore/objectstore.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/zenserver/storage/objectstore/objectstore.cpp b/src/zenserver/storage/objectstore/objectstore.cpp index 3f40bf616..d8ad40621 100644 --- a/src/zenserver/storage/objectstore/objectstore.cpp +++ b/src/zenserver/storage/objectstore/objectstore.cpp @@ -271,6 +271,9 @@ HttpObjectStoreService::Inititalize() CreateDirectories(BucketsPath); } + m_Router.AddPattern("path", "([[:alnum:]/_.,;$~\\{\\}\\+\\-\\[\\]\\%\\(\\)]+)"); + m_Router.AddPattern("bucket", "([[:alnum:]\\-_.]+)"); + m_Router.RegisterRoute( "bucket", [this](zen::HttpRouterRequest& Request) { CreateBucket(Request); }, @@ -284,9 +287,10 @@ HttpObjectStoreService::Inititalize() m_Router.RegisterRoute( "bucket/{path}", [this](zen::HttpRouterRequest& Request) { - const std::string_view Path = Request.GetCapture(1); - const auto Sep = Path.find_last_of('.'); - const bool IsObject = Sep != std::string::npos && Path.size() - Sep > 0; + const std::string_view EncodedPath = Request.GetCapture(1); + const std::string Path = Request.ServerRequest().Decode(EncodedPath); + const auto Sep = Path.find_last_of('.'); + const bool IsObject = Sep != std::string::npos && Path.size() - Sep > 0; if (IsObject) { |