diff options
| author | Dan Engelbrecht <[email protected]> | 2025-12-03 13:00:37 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-12-03 13:00:37 +0100 |
| commit | 9af8c53e767454f9cab0b25940b16594c320be0b (patch) | |
| tree | cd30eac3cc9c1fd3f3a9d92e5368c161cc3b8d20 /src/zenserver/storage/objectstore | |
| parent | 5.7.13-pre1 (diff) | |
| download | zen-9af8c53e767454f9cab0b25940b16594c320be0b.tar.xz zen-9af8c53e767454f9cab0b25940b16594c320be0b.zip | |
add missing patterns to objectstore service http routing (#674)
Diffstat (limited to 'src/zenserver/storage/objectstore')
| -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) { |