Problem when try change Workspace name using API Rest

Description

When try to change workspace name using API Rest, geoserver gives error

$curl -v -u admin:geoserver -XPUT -H "Content-type: application/json" -d "{ "workspace": { "name":"topp2"}}" http://localhost:8080/geoserver/rest/workspaces/topp

Caused by: org.geoserver.rest.RestException 403 FORBIDDEN: Can't change name of workspace

Line 178 at WorkspaceController.workspacePut theres wrong logic test:
{{!workspaceName.equals(infoName) }} when should be workspaceName.equals(infoName)
Thats because this test should throw an exception if the workspaceName is equal as requested one, not different.

Environment

None

Status

Assignee

Unassigned

Reporter

Luiz Caires

Triage

None

Fix versions

Affects versions

Components

Priority

Medium
Configure