{"record":{"id":"eb5309f9354529ba","repo":"epi052/feroxbuster","slug":"invalid-request-missing-request-line","errorCode":null,"errorMessage":"Invalid request: Missing request line","messagePattern":"Invalid request: Missing request line","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/utils.rs","lineNumber":482,"sourceCode":"    // decode only the head; HTTP framing is generally ascii/utf-8\n    // compatible\n    let head = std::str::from_utf8(head_bytes)\n        .map_err(|_| anyhow::anyhow!(\"Request headers contain invalid UTF-8\"))?;\n\n    // normalize line endings in the decoded head\n    let normalized = head.replace(\"\\r\\n\", \"\\n\");\n\n    // we only want to use the request's body bytes if the user hasn't\n    // overridden it on the cli\n    if config.data.is_empty() {\n        config.data = body_bytes.to_vec();\n    }\n\n    // begin parsing the request line and normalized headers\n    let mut head_parts = normalized.split(\"\\n\");\n\n    let Some(request_line) = head_parts.next() else {\n        bail!(\"Invalid request: Missing request line\");\n    };\n\n    if request_line.is_empty() {\n        bail!(\"Invalid request: Empty request line\");\n    }\n\n    let mut request_parts = request_line.split_whitespace();\n\n    let Some(method) = request_parts.next() else {\n        bail!(\"Invalid request: Missing method\");\n    };\n\n    if method.is_empty() {\n        bail!(\"Invalid request: Empty method\");\n    }\n\n    let method = method.to_string();\n","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/config/utils.rs#L464-L500","documentation":"After locating the head/body separator, parse_request_file splits the (normalized) head into lines and takes the first as the HTTP request line. If the head section splits into no parts at all, there is no request line, so the function throws. This is a defensive branch — an empty head is normally caught by earlier checks, but normalization can still leave a head that yields nothing.","triggerScenarios":"A `--request-file` whose head section contains no lines after normalization — e.g. the file consists only of a separator (`\\r\\n\\r\\n`), or whitespace that normalizes away entirely.","commonSituations":"Files containing only the CRLF CRLF separator pasted from a clipboard, requests where the request line was accidentally deleted leaving headers plus blank line, or empty-body-only dumps.","solutions":["Add a valid request line (e.g. `GET /path HTTP/1.1`) as the first line of the request file","Re-copy the complete raw request including its request line","Verify the file starts with the method rather than a blank line or separator"],"exampleFix":"// before (request.txt)\nHost: example.com\n\n// after\nGET / HTTP/1.1\nHost: example.com\n\n","handlingStrategy":"validation","validationCode":"let text = String::from_utf8_lossy(&contents);\nlet head = text.split(\"\\n\\n\").next().unwrap_or(\"\");\nif head.trim().is_empty() { return Err(anyhow!(\"request file has no request line\")); }","typeGuard":null,"tryCatchPattern":"match parse_request_file(&mut config) {\n    Ok(()) => {},\n    Err(e) => eprintln!(\"bad --request-file: {e}; first line must be a request line like 'GET / HTTP/1.1'\"),\n}","preventionTips":["Start the request file with the METHOD path HTTP-version line","Do not paste clipboard content that begins with blank lines or only headers","Inspect the first bytes of the file (head -c 200 request.txt) before running"],"tags":["request-file","http","malformed-input","rust"],"backgroundTag":"invalid-argument-format","analyzedSha":"1f595dab5c76858d5a14fbc47dabf2563d729c62","analyzedAt":"2026-09-13T19:33:06.208Z","contentChangedAt":"2026-09-13T19:33:06.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}