{"record":{"id":"58fef9e33002108b","repo":"projectdiscovery/nuclei","slug":"could-not-read-request-body-w","errorCode":null,"errorMessage":"could not read request body: %w","messagePattern":"could not read request body: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/http/raw/raw.go","lineNumber":275,"sourceCode":"\t\t_, found := rawRequest.Headers[key]\n\t\tif unsafe {\n\t\t\trawRequest.UnsafeHeaders = append(rawRequest.UnsafeHeaders, client.Header{Key: line})\n\t\t}\n\n\t\tif unsafe && found {\n\t\t\trawRequest.Headers[line] = \"\"\n\t\t} else {\n\t\t\trawRequest.Headers[key] = strings.TrimSpace(value)\n\t\t}\n\t\tif readErr == io.EOF {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Set the request body\n\tb, err := io.ReadAll(reader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read request body: %w\", err)\n\t}\n\trawRequest.Data = string(b)\n\tif !multiPartRequest {\n\t\trawRequest.Data = strings.TrimSuffix(rawRequest.Data, \"\\r\\n\")\n\t}\n\treturn rawRequest, nil\n\n}\n\nfunc stripLeadingAnnotations(request string) []byte {\n\treader := bufio.NewReader(strings.NewReader(request))\n\tbuffer := bufferPool.Get().(*bytes.Buffer)\n\tbuffer.Reset()\n\tdefer func() {\n\t\tbuffer.Reset()\n\t\tbufferPool.Put(buffer)\n\t}()\n","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/http/raw/raw.go#L257-L293","documentation":"Error \"could not read request body: %w\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/http/raw/raw.go:275 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":"265b3a3dec374741614e342f813c10f8b38d2bb7","analyzedAt":"2026-08-15T20:05:51.855Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}