{"record":{"id":"c0eb217e78799bf1","repo":"epi052/feroxbuster","slug":"invalid-request-missing-method","errorCode":null,"errorMessage":"Invalid request: Missing method","messagePattern":"Invalid request: Missing method","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/utils.rs","lineNumber":492,"sourceCode":"    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\n    if !config.methods.contains(&method) {\n        config.methods.push(method);\n    }\n\n    let Some(uri) = request_parts.next() else {\n        bail!(\"Invalid request: Missing request line URI\");\n    };\n\n    if uri.is_empty() {\n        bail!(\"Invalid request: Empty request line URI\");","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/config/utils.rs#L474-L510","documentation":"parse_request_file splits the request line on whitespace and takes the first token as the HTTP method. If the line splits into no tokens (e.g. it contains only whitespace-like characters that survived earlier checks), there is no method and the function throws. A valid request line must begin with an HTTP method token.","triggerScenarios":"A `--request-file` whose first non-empty line contains no whitespace-delimited method token — practically, a line of only unusual whitespace characters that passed the empty-string check but yields no split parts.","commonSituations":"Corrupted or hand-mangled request files where the method text was replaced by stray whitespace/tab characters, or truncated files that kept only fragments of the request line.","solutions":["Ensure the first line starts with a valid HTTP method (GET, POST, PUT, DELETE, etc.) followed by a space","Re-copy or re-export the raw request to restore the intact request line","Open the file in a hex/whitespace-visible editor to spot invisible characters replacing the method"],"exampleFix":"// before (request.txt first line)\n\\t\\t\n// after\nGET / HTTP/1.1","handlingStrategy":"validation","validationCode":"let text = std::fs::read_to_string(&path)?;\nlet first = text.lines().next().unwrap_or(\"\");\nif first.split_whitespace().next().is_none() {\n    return Err(anyhow!(\"request line has no method token\"));\n}","typeGuard":null,"tryCatchPattern":"match parse_request_file(&mut config) {\n    Ok(()) => {},\n    Err(e) => eprintln!(\"bad --request-file: {e}; first line must start with an HTTP method\"),\n}","preventionTips":["Confirm the request line reads 'METHOD /path HTTP/1.1' with visible method text","Check for invisible whitespace corrupting the first line (cat -A request.txt)","Re-export the raw request rather than hand-editing a truncated copy"],"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"}