{"record":{"id":"8813df6d0b9bc1e9","repo":"projectdiscovery/nuclei","slug":"could-not-read-request-w","errorCode":null,"errorMessage":"could not read request: %w","messagePattern":"could not read request: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/protocols/http/build_request.go","lineNumber":332,"sourceCode":"\n\t// priority of variables is as follows (from low to high) for self contained templates\n\t// default signer vars < variables < cli vars < dynamic values < payload < constants\n\n\t// evaluate request\n\tdata, err := r.renderText(data, values)\n\tif err != nil {\n\t\treturn nil, errkit.Wrap(err, \"could not evaluate helper expressions\")\n\t}\n\n\t// If the request is a raw request, get the URL from the request\n\t// header and use it to make the request.\n\tif isRawRequest {\n\t\t// Get the hostname from the URL section to build the request.\n\t\treader := bufio.NewReader(strings.NewReader(data))\n\tread_line:\n\t\ts, err := reader.ReadString('\\n')\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not read request: %w\", err)\n\t\t}\n\n\t\t// ignore all annotations\n\t\tif stringsutil.HasPrefixAny(s, \"@\") {\n\t\t\tgoto read_line\n\t\t}\n\n\t\tparts := strings.Split(s, \" \")\n\t\tif len(parts) < 3 {\n\t\t\treturn nil, fmt.Errorf(\"malformed request supplied\")\n\t\t}\n\n\t\tif err := expressions.ContainsUnresolvedVariables(parts[1]); err != nil && !r.request.SkipVariablesCheck {\n\t\t\treturn nil, errkit.Newf(\"unresolved variables `%v` found in request\", parts[1])\n\t\t}\n\n\t\tparsed, err := urlutil.ParseURL(parts[1], true)\n\t\tif err != nil {","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/projectdiscovery/nuclei/blob/265b3a3dec374741614e342f813c10f8b38d2bb7/pkg/protocols/http/build_request.go#L314-L350","documentation":"Error \"could not read request: %w\" thrown in projectdiscovery/nuclei.","triggerScenarios":"Thrown at pkg/protocols/http/build_request.go:332 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"}