{"record":{"id":"8f6a6704efb92e0c","repo":"juanfont/headscale","slug":"method-not-allowed","errorCode":null,"errorMessage":"method not allowed","messagePattern":"method not allowed","errorType":"http","errorClass":null,"httpStatus":405,"severity":"error","filePath":"hscontrol/noise.go","lineNumber":321,"sourceCode":"\t\t\tnext.ServeHTTP(w, r)\n\t\t})\n\t}\n}\n\nfunc (ns *noiseServer) NotImplementedHandler(writer http.ResponseWriter, req *http.Request) {\n\tlog.Trace().Caller().Str(\"path\", req.URL.String()).Msg(\"not implemented handler hit\")\n\thttp.Error(writer, \"Not implemented yet\", http.StatusNotImplemented)\n}\n\n// PingResponseHandler handles HEAD requests from clients responding to a\n// [tailcfg.PingRequest]. The client calls this endpoint to prove connectivity.\n// The unguessable ping ID serves as authentication.\nfunc (h *Headscale) PingResponseHandler(\n\twriter http.ResponseWriter,\n\treq *http.Request,\n) {\n\tif req.Method != http.MethodHead {\n\t\thttp.Error(writer, \"method not allowed\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\n\tpingID := req.URL.Query().Get(\"id\")\n\tif pingID == \"\" {\n\t\thttp.Error(writer, \"missing ping ID\", http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tif h.state.CompletePing(pingID) {\n\t\twriter.WriteHeader(http.StatusOK)\n\t} else {\n\t\thttp.Error(writer, \"unknown or expired ping\", http.StatusNotFound)\n\t}\n}\n\nfunc stringParam(req *http.Request, key string) (string, error) {\n\tparam := chi.URLParam(req, key)","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/juanfont/headscale/blob/565fd254d06c4c7f9a8cad1714a43445c79ba420/hscontrol/noise.go#L303-L339","documentation":"Error \"method not allowed\" thrown in juanfont/headscale.","triggerScenarios":"Thrown at hscontrol/noise.go:321 when the library encounters an invalid state.","commonSituations":"The HTTP method used is not allowed on this endpoint. This indicates a misbehaving or incompatible client.","solutions":["Inspect the wrapped error for the underlying cause and correct the failing condition (method not allowed); retry the operation after fixing the input, configuration, or environment."],"exampleFix":"Inspect the wrapped error for the underlying cause and correct the failing condition (method not allowed); retry the operation after fixing the input, configuration, or environment.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"565fd254d06c4c7f9a8cad1714a43445c79ba420","analyzedAt":"2026-08-15T13:12:30.133Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}