{"record":{"id":"890e296465f72600","repo":"epi052/feroxbuster","slug":"invalid-request-empty-method","errorCode":null,"errorMessage":"Invalid request: Empty method","messagePattern":"Invalid request: Empty method","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/utils.rs","lineNumber":496,"sourceCode":"    // 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\");\n    }\n\n    for mut line in head_parts {\n        line = line.trim_matches('\\r').trim();","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/config/utils.rs#L478-L514","documentation":"This error is thrown by parse_request_file when the first token of a raw HTTP request line (the method) is an empty string. The library parses a request file's first line into METHOD URI VERSION, and without a method the request cannot be forwarded, so parsing is aborted with this error.","triggerScenarios":"Calling parse_request_file (via Config::new) on a request file whose first line starts with whitespace or is blank, e.g. a file beginning with ' /path' or an empty first line, so request_parts.next() yields Some(\"\").","commonSituations":"Malformed request files exported by hand or copied from browser tools with a leading blank line or missing method; users editing raw request captures in an editor and accidentally deleting the method token.","solutions":["Open the request file and ensure the first line starts with a valid HTTP method token followed by a space (e.g. GET / HTTP/1.1)","Remove any leading whitespace or blank lines at the start of the file (head -1 file shows the offending line)","Re-export the request from the original tool (curl -x, burp 'copy as raw') to get a clean request line","Add 'GET / HTTP/1.1' as the first line if the file only contains headers/body"],"exampleFix":"// before\nlet raw = \"\\n /target HTTP/1.1\\nHost: site.com\";\n// after\nlet raw = \"GET /target HTTP/1.1\\nHost: site.com\";","handlingStrategy":"validation","validationCode":"fn validate_request_raw(raw: &str) -> Result<(), String> {\n    let first = raw.lines().next().unwrap_or(\"\");\n    let method = first.split_whitespace().next().unwrap_or(\"\");\n    if method.is_empty() {\n        return Err(\"request file's first line must start with an HTTP method\".into());\n    }\n    Ok(())\n}","typeGuard":"fn has_method(raw: &str) -> bool {\n    raw.lines().next()\n        .and_then(|l| l.split_whitespace().next())\n        .map(|m| !m.is_empty())\n        .unwrap_or(false)\n}","tryCatchPattern":null,"preventionTips":["Always export raw requests from tooling (curl, burp) rather than hand-editing","Check the first line with head -1 before pointing the tool at a request file","Strip leading blank lines/whitespace from exported request files","Keep template request files with a full 'GET / HTTP/1.1' request line"],"tags":["http","request-parsing","config"],"backgroundTag":"empty-required-field","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"}