Skip to content

No Jira Issue: keep dots in workspace names out of REST path extension parsing - #99

Merged
lambdatronic merged 1 commit into
mainfrom
dsilva-fix-dotted-workspace-rest-urls
Aug 31, 2026
Merged

lambdatronic merged 1 commit into
mainfrom
dsilva-fix-dotted-workspace-rest-urls

Conversation

@danielhvs

Copy link
Copy Markdown
Collaborator

Removing a workspace whose name contains a dot failed. GeoServer and GWC strip everything after the last . of the final path segment as a format extension, so fuels-and-topography_landfire-2.5.0 resolved to fuels-and-topography_landfire-2.5 and returned 404 for all six cached layers and for the workspace itself, ending in GeoSync: Errors encountered during workspace removal.

  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.

Resulting paths for a dotted workspace:

DELETE /workspaces/fuels-and-topography_landfire-2.5.0/?recurse=true
GET    /../gwc/rest/layers/fuels-and-topography_landfire-2.5.0:cbd.json
DELETE /../gwc/rest/layers/fuels-and-topography_landfire-2.5.0:cbd.xml

Verified against a live GeoServer in development. Eleven fuels-and-topography_landfire-* workspaces carry dots and were all affected.

Not covered: roughly 25 other paths in rest_api.clj end in a user-controlled name (datastores/<store>, layers/<layer>, coverages/<coverage>, layergroups/<group>, namespaces/<ws>) and have the same weakness. No current layer name contains a dot, so they are left alone here.

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.

@aliceliquori aliceliquori left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Paths like this are always so sneaky. Good work.

@lambdatronic lambdatronic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@lambdatronic
lambdatronic merged commit 31f61ea into main Aug 31, 2026
1 check passed
@lambdatronic
lambdatronic deleted the dsilva-fix-dotted-workspace-rest-urls branch August 31, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants