{"record":{"id":"194f6e8f77f5f354","repo":"router-for-me/CLIProxyAPI","slug":"httpwire-request-header-exceeds-d-bytes","errorCode":null,"errorMessage":"httpwire: request header exceeds %d bytes","messagePattern":"httpwire: request header exceeds (.+?) bytes","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/httpwire/ordered_conn.go","lineNumber":86,"sourceCode":"\t\t\tif errConsume != nil {\n\t\t\t\treturn consumed, errConsume\n\t\t\t}\n\t\t\tif completed {\n\t\t\t\tc.chunked = nil\n\t\t\t}\n\t\t\tif errWrite != nil {\n\t\t\t\treturn consumed, errWrite\n\t\t\t}\n\t\t\tremaining = remaining[chunkBytes:]\n\t\t\tcontinue\n\t\t}\n\n\t\tpreviousHeaderLength := len(c.header)\n\t\tc.header = append(c.header, remaining...)\n\t\theaderEnd := bytes.Index(c.header, []byte(\"\\r\\n\\r\\n\"))\n\t\tif headerEnd < 0 {\n\t\t\tif len(c.header) > maxBufferedRequestHeader {\n\t\t\t\treturn consumed, fmt.Errorf(\"httpwire: request header exceeds %d bytes\", maxBufferedRequestHeader)\n\t\t\t}\n\t\t\treturn originalLength, nil\n\t\t}\n\n\t\theaderEnd += len(\"\\r\\n\\r\\n\")\n\t\theader := c.header[:headerEnd]\n\t\tbody := c.header[headerEnd:]\n\t\tc.header = nil\n\t\tcurrentHeaderBytes := min(len(remaining), max(0, headerEnd-previousHeaderLength))\n\n\t\tordered, contentLength, chunked := orderRequestHeader(header, c.order)\n\t\tif _, errWrite := writeAll(c.Conn, ordered); errWrite != nil {\n\t\t\t// All caller bytes were accepted into the wrapper before the transformed\n\t\t\t// header write failed. Return the full input count with the terminal\n\t\t\t// connection error so callers do not replay an ambiguous partial header.\n\t\t\treturn originalLength, errWrite\n\t\t}\n\t\tconsumed += currentHeaderBytes","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/httpwire/ordered_conn.go#L68-L104","documentation":"Error \"httpwire: request header exceeds %d bytes\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/httpwire/ordered_conn.go:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the request header size below the stated byte limit.","Check for runaway header generation (e.g. huge cookies or tokens)."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}