{"record":{"id":"11025b8cad06968e","repo":"getsops/sops","slug":"missing-location-header","errorCode":null,"errorMessage":"missing Location header","messagePattern":"missing Location header","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"version/version.go","lineNumber":190,"sourceCode":"\t\t}\n\t\treturn nil\n\t}\n\n\tresp, err := client.Head(fmt.Sprintf(\"%s/%s/releases/latest\", f.endpoint, repository))\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tif resp.Body != nil {\n\t\tdefer resp.Body.Close()\n\t}\n\n\tif resp.StatusCode < 300 || resp.StatusCode > 399 {\n\t\treturn \"\", \"\", fmt.Errorf(\"unexpected status code: %d\", resp.StatusCode)\n\t}\n\n\tlocation := resp.Header.Get(\"Location\")\n\tif location == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"missing Location header\")\n\t}\n\n\ttagMarker := \"releases/tag/\"\n\tif tagIndex := strings.Index(location, tagMarker); tagIndex != -1 {\n\t\treturn location[tagIndex+len(tagMarker):], location, nil\n\t}\n\treturn \"\", \"\", fmt.Errorf(\"unexpected Location header: %s\", location)\n}\n\n// LatestReleaseUsingAPI retrieves the most recent release version from the\n// GitHub API. It returns the latest version as a string, along with its\n// corresponding URL, or an error in case of request failure or parsing issues\n// with the response.\n//\n// This approach boasts higher reliability compared to\n// LatestReleaseUsingRedirect as it leverages the versioned GitHub API.\n// However, it can be affected by GitHub API rate limiting.\nfunc (f releaseFetcher) LatestReleaseUsingAPI(repository string) (tag, url string, err error) {","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/getsops/sops/blob/13442bb98183887d7a9ac09ec8ab0564673a59d8/version/version.go#L172-L208","documentation":"Error \"missing Location header\" thrown in getsops/sops.","triggerScenarios":"Thrown at version/version.go:190 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":"13442bb98183887d7a9ac09ec8ab0564673a59d8","analyzedAt":"2026-09-01T03:53:00.447Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}