{"record":{"id":"db90bddd82076232","repo":"tailscale/tailscale","slug":"want-get-to-list-targets","errorCode":null,"errorMessage":"want GET to list targets","messagePattern":"want GET to list targets","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"feature/taildrop/localapi.go","lineNumber":484,"sourceCode":"\t}\n\trc, size, err := ext.OpenFile(name)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tdefer rc.Close()\n\tw.Header().Set(\"Content-Length\", fmt.Sprint(size))\n\tw.Header().Set(\"Content-Type\", \"application/octet-stream\")\n\tio.Copy(w, rc)\n}\n\nfunc serveFileTargets(h *localapi.Handler, w http.ResponseWriter, r *http.Request) {\n\tif !h.PermitRead {\n\t\thttp.Error(w, \"access denied\", http.StatusForbidden)\n\t\treturn\n\t}\n\tif r.Method != \"GET\" {\n\t\thttp.Error(w, \"want GET to list targets\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\text, ok := ipnlocal.GetExt[*Extension](h.LocalBackend())\n\tif !ok {\n\t\thttp.Error(w, \"misconfigured taildrop extension\", http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tfts, err := ext.FileTargets()\n\tif err != nil {\n\t\tlocalapi.WriteErrorJSON(w, err)\n\t\treturn\n\t}\n\tmak.NonNilSliceForJSON(&fts)\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(fts)\n}","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/tailscale/tailscale/blob/6e0912f97994f927632b34ae9e63b53d6516a6ac/feature/taildrop/localapi.go#L466-L502","documentation":"serveFileTargets is read-only and only supports GET. Any other method is rejected with 400 (not 405) by this handler.","triggerScenarios":"Thrown at feature/taildrop/localapi.go:484 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use HTTP GET to list taildrop targets."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6e0912f97994f927632b34ae9e63b53d6516a6ac","analyzedAt":"2026-08-18T08:17:25.280Z","contentChangedAt":"2026-08-18T08:17:25.280Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}