fix: encode headscale rename path segments

(cherry picked from commit 623e7c03f1)
This commit is contained in:
Aarnav Tale
2026-05-14 13:03:53 -04:00
parent c6b6cbc122
commit 1e0ff7ead6
3 changed files with 76 additions and 2 deletions
+5 -1
View File
@@ -145,7 +145,11 @@ export default defineApiEndpoints<NodeEndpoints>((client, apiKey) => ({
},
renameNode: async (nodeId, newName) => {
await client.apiFetch<void>("POST", `v1/node/${nodeId}/rename/${newName}`, apiKey);
await client.apiFetch<void>(
"POST",
`v1/node/${nodeId}/rename/${encodeURIComponent(newName)}`,
apiKey,
);
},
setNodeTags: async (nodeId, tags) => {
+5 -1
View File
@@ -78,6 +78,10 @@ export default defineApiEndpoints<UserEndpoints>((client, apiKey) => ({
},
renameUser: async (oldId, newName) => {
await client.apiFetch<void>("POST", `v1/user/${oldId}/rename/${newName}`, apiKey);
await client.apiFetch<void>(
"POST",
`v1/user/${oldId}/rename/${encodeURIComponent(newName)}`,
apiKey,
);
},
}));