epi052/feroxbuster · error

Invalid request: Empty request line URI

Error message

Invalid request: Empty request line URI

What it means

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).

Solutions

  1. Ensure a non-empty path follows the method on the first line (at minimum '/')
  2. Normalize the request line with a single space between METHOD, URI and VERSION (e.g. tr -s ' ' on the first line)
  3. Check for invisible characters (tabs/CR) that consume the URI token; strip or rewrite the first line

Example fix

// before
"GET   HTTP/1.1"
// after
"GET / HTTP/1.1"
Defensive patterns

Strategy: validation

Validate before calling

fn request_line_uri_nonempty(raw: &str) -> Result<(), String> {
    let line = raw.lines().next().unwrap_or("");
    let parts: Vec<&str> = line.split_whitespace().collect();
    if parts.len() >= 2 && !parts[1].is_empty() {
        Ok(())
    } else {
        Err("request line URI token missing or empty".into())
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of epi052/feroxbuster@1f595dab5c (2026-09-13). Data as JSON: /api/errors/fd8ff9286a57d1ee. Report an issue: GitHub.

Appendix: source

Thrown at src/config/utils.rs:510

        bail!("Invalid request: Missing method");
    };

    if method.is_empty() {
        bail!("Invalid request: Empty method");
    }

    let method = method.to_string();

    if !config.methods.contains(&method) {
        config.methods.push(method);
    }

    let Some(uri) = request_parts.next() else {
        bail!("Invalid request: Missing request line URI");
    };

    if uri.is_empty() {
        bail!("Invalid request: Empty request line URI");
    }

    for mut line in head_parts {
        line = line.trim_matches('\r').trim();

        if line.is_empty() {
            break; // Empty line signals the end of headers
        }

        let Ok((name, value)) = split_header(line) else {
            log::warn!("Invalid header: {line}");
            continue;
        };

        if name.is_empty() {
            log::warn!("Invalid header name: {line}");
            continue;
        }

View on GitHub (pinned to 1f595dab5c)