From 78e39079278485b5840df6e20b3db93faa9d6dd5 Mon Sep 17 00:00:00 2001 From: Daniel Silva Date: Fri, 28 Aug 2026 16:18:48 -0300 Subject: [PATCH] Keep dots in workspace names out of REST path extension parsing GeoServer and GWC strip everything after the last "." of the final path segment as a format extension, so removing fuels-and-topography_landfire-2.5.0 resolved to ...landfire-2.5 and 404'd on all six cached layers and on the workspace itself. 1. delete-workspace terminates the name with "/", as get-workspace and update-workspace already do. 2. delete-cached-layer appends ".xml", as update-cached-layer already does. 3. get-cached-layer appends ".json" rather than ".xml" because get-existing-gwc-layer reads that body with json/read-str. --- src/geosync/rest_api.clj | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/geosync/rest_api.clj b/src/geosync/rest_api.clj index a904c90..f25f52b 100644 --- a/src/geosync/rest_api.clj +++ b/src/geosync/rest_api.clj @@ -36,9 +36,13 @@ [:workspace [:name workspace]])]) +;; GeoServer strips everything after the last "." of the final path segment as a +;; format extension, so a dotted workspace name ("...landfire-2.5.0") resolves to +;; "...landfire-2.5" and 404s. The trailing "/" leaves nothing to strip, the same +;; way get-workspace and update-workspace above already do it. (defn delete-workspace [workspace recurse?] ["DELETE" - (str "/workspaces/" workspace "?recurse=" recurse?) + (str "/workspaces/" workspace "/?recurse=" recurse?) nil]) ;;=============================================================================================================== @@ -805,9 +809,11 @@ ;; ;;=============================================================================================================== +;; ".json" both defeats the extension parsing described above and keeps the body +;; JSON, which get-existing-gwc-layer reads with json/read-str. (defn get-cached-layer [workspace layer] ["GET" - (str "/../gwc/rest/layers/" workspace ":" layer) + (str "/../gwc/rest/layers/" workspace ":" layer ".json") nil]) ;;FIXME: gridsubsets comes from the existing gwc layer. Figure out a way to @@ -855,7 +861,7 @@ ;; rows afterwards costs 83% less because the freed pages get reused. (defn delete-cached-layer [workspace layer] ["DELETE" - (str "/../gwc/rest/layers/" workspace ":" layer) + (str "/../gwc/rest/layers/" workspace ":" layer ".xml") nil]) ;;===============================================================================================================