{"record":{"id":"603cdef09dc824b9","repo":"nextcloud/server","slug":"missing-content-location-header","errorCode":null,"errorMessage":"Missing \"Content-Location\" header","messagePattern":"Missing \"Content-Location\" header","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/systemtags/src/services/api.ts","lineNumber":102,"sourceCode":" * Create a tag and return the Id of the newly created tag.\n *\n * @param tag The tag to create\n */\nexport async function createTag(tag: Tag | ServerTag): Promise<number> {\n\tconst path = '/systemtags'\n\tconst tagToPost = formatTag(tag)\n\ttry {\n\t\tconst { headers } = await davClient.customRequest(path, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: tagToPost,\n\t\t})\n\t\tconst contentLocation = headers.get('content-location')\n\t\tif (contentLocation) {\n\t\t\temit('systemtags:tag:created', tag)\n\t\t\treturn parseIdFromLocation(contentLocation)\n\t\t}\n\t\tlogger.error(t('systemtags', 'Missing \"Content-Location\" header'))\n\t\tthrow new Error(t('systemtags', 'Missing \"Content-Location\" header'))\n\t} catch (error) {\n\t\tif ((error as WebDAVClientError)?.response?.status === 409) {\n\t\t\tlogger.error(t('systemtags', 'A tag with the same name already exists'), { error })\n\t\t\tthrow new Error(t('systemtags', 'A tag with the same name already exists'), { cause: error })\n\t\t}\n\t\tlogger.error(t('systemtags', 'Failed to create tag'), { error })\n\t\tthrow new Error(t('systemtags', 'Failed to create tag'), { cause: error })\n\t}\n}\n\n/**\n * Update a tag on the server.\n *\n * @param tag - The tag to update\n */\nexport async function updateTag(tag: TagWithId): Promise<void> {\n\tconst path = '/systemtags/' + tag.id\n\tconst data = `<?xml version=\"1.0\"?>","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/systemtags/src/services/api.ts#L84-L120","documentation":"Error \"Missing \"Content-Location\" header\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/systemtags/src/services/api.ts:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}