{"record":{"id":"118947d4d23e2fcd","repo":"probelabs/goreplay","slug":"http-statustext-200","errorCode":null,"errorMessage":"http.StatusText(200)","messagePattern":"http\\.StatusText\\(200\\)","errorType":"http","errorClass":null,"httpStatus":200,"severity":"info","filePath":"input_http.go","lineNumber":54,"sourceCode":"\tcase buf := <-i.data:\n\t\tmsg.Data = buf\n\t\tmsg.Meta = payloadHeader(RequestPayload, uuid(), time.Now().UnixNano(), -1)\n\t\treturn &msg, nil\n\t}\n}\n\n// Close closes this plugin\nfunc (i *HTTPInput) Close() error {\n\tclose(i.stop)\n\treturn nil\n}\n\nfunc (i *HTTPInput) handler(w http.ResponseWriter, r *http.Request) {\n\tr.URL.Scheme = \"http\"\n\tr.URL.Host = i.address\n\n\tbuf, _ := httputil.DumpRequestOut(r, true)\n\thttp.Error(w, http.StatusText(200), 200)\n\ti.data <- buf\n}\n\nfunc (i *HTTPInput) listen(address string) {\n\tvar err error\n\n\tmux := http.NewServeMux()\n\n\tmux.HandleFunc(\"/\", i.handler)\n\n\ti.listener, err = net.Listen(\"tcp\", address)\n\tif err != nil {\n\t\tlog.Fatal(\"HTTP input listener failure:\", err)\n\t}\n\ti.address = i.listener.Addr().String()\n\n\tgo func() {\n\t\terr = http.Serve(i.listener, mux)","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/input_http.go#L36-L72","documentation":"HTTPInput.handler receives an inbound HTTP request, dumps it (including body) into the data channel, and responds with http.Error(w, http.StatusText(200), 200) — i.e. the literal text '200 OK' with status 200. This is not a failure: the message string is just the constant 'http.StatusText(200)'; it appears in logs/traces as the response body the input returns to senders.","triggerScenarios":"Any client POSTing an event to the HTTP input's listening address; the handler always replies with status 200 and body '200 OK'.","commonSituations":"Clients parsing the response body expecting JSON and seeing the plain text '200 OK'; confusion when monitoring shows body '200 OK'; misuse of http.Error for a success path (it sets the body to the status text).","solutions":["Treat a 200 status as success; the body is informational text, not an error.","If a structured ack is needed, change the handler to w.WriteHeader(http.StatusOK) with your own body (e.g. JSON).","Don't use http.Error for non-error responses; it forces the status text as body."],"exampleFix":"// before\nhttp.Error(w, http.StatusText(200), 200)\n// after\nw.WriteHeader(http.StatusOK)\nw.Write([]byte(\"ok\\n\"))","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"resp, err := http.Post(inputURL, \"application/json\", body)\nif err != nil { return err }\ndefer resp.Body.Close()\nif resp.StatusCode != http.StatusOK {\n\tb, _ := io.ReadAll(resp.Body)\n\treturn fmt.Errorf(\"http input returned %d: %s\", resp.StatusCode, b)\n}\n// 200 with body \"200 OK\" is the normal ack","preventionTips":["Check resp.StatusCode, not the body text, for success","Expect plain-text body '200 OK' from this input","Don't attempt JSON decode of the ack body","Use an idempotent client retry only on transport errors, not 200s"],"tags":["http","input","success-response","go"],"backgroundTag":"http-200-plain-text-response","analyzedSha":"251e45abd242886bb64ff2b2dc98789556b56330","analyzedAt":"2026-09-02T16:44:11.369Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}