{"record":{"id":"fd8ff9286a57d1ee","repo":"epi052/feroxbuster","slug":"invalid-request-empty-request-line-uri","errorCode":null,"errorMessage":"Invalid request: Empty request line URI","messagePattern":"Invalid request: Empty request line URI","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/utils.rs","lineNumber":510,"sourceCode":"        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();\n\n        if line.is_empty() {\n            break; // Empty line signals the end of headers\n        }\n\n        let Ok((name, value)) = split_header(line) else {\n            log::warn!(\"Invalid header: {line}\");\n            continue;\n        };\n\n        if name.is_empty() {\n            log::warn!(\"Invalid header name: {line}\");\n            continue;\n        }","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/config/utils.rs#L492-L528","documentation":"Thrown by parse_request_file when the URI token on the request line is present but empty. After the method is read, the next token is checked; an empty string here means the request line is malformed (e.g. trailing space with no path).","triggerScenarios":"A request line like 'GET  HTTP/1.1' with double spaces or a method followed by trailing whitespace, so uri.is_empty() evaluates true after whitespace splitting.","commonSituations":"Files edited in editors that preserve trailing spaces; requests reconstructed by concatenation scripts that drop the path; template request files with an unfilled URI placeholder.","solutions":["Ensure a non-empty path follows the method on the first line (at minimum '/')","Normalize the request line with a single space between METHOD, URI and VERSION (e.g. tr -s ' ' on the first line)","Check for invisible characters (tabs/CR) that consume the URI token; strip or rewrite the first line"],"exampleFix":"// before\n\"GET   HTTP/1.1\"\n// after\n\"GET / HTTP/1.1\"","handlingStrategy":"validation","validationCode":"fn request_line_uri_nonempty(raw: &str) -> Result<(), String> {\n    let line = raw.lines().next().unwrap_or(\"\");\n    let parts: Vec<&str> = line.split_whitespace().collect();\n    if parts.len() >= 2 && !parts[1].is_empty() {\n        Ok(())\n    } else {\n        Err(\"request line URI token missing or empty\".into())\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize whitespace in the request line (single spaces, no tabs)","Use an editor that trims trailing spaces, or run sed to clean the file","Always include an explicit path ('/') in generated requests"],"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"}