epi052/feroxbuster · error
Empty header name provided
Error message
Empty header name provided
What it means
split_header requires a non-empty header name before the first `:`. If the input starts with `:` (or the name is only whitespace after trimming), no header name exists and the function throws. Unlike the multiple-colon case, the value may still contain colons — only the name may not be empty.
Solutions
- Add the missing header name before the colon (e.g. `Authorization: Bearer xyz`)
- Check templated request files for header-name variables that expand to empty strings
- Validate each header entry matches `Name: value` before passing it to the parser
Example fix
// before xatu --header ": application/json" // after xatu --header "Content-Type: application/json"
Defensive patterns
Strategy: validation
Validate before calling
if !h.trim().is_empty() && !h.trim_start().starts_with(':') { /* safe to parse */ } Try / catch
match split_header(entry) {
Ok((name, value)) => insert_header(name, value),
Err(e) => eprintln!("invalid header entry '{entry}': {e}"),
} Prevention
- Always include the header name before the colon
- Verify templated header lines have non-empty name variables
- Lint header entries for a leading ':' before passing them to the parser
When it happens
Trigger: Calling split_header(":value") or split_header(" :value") — everything before the first `:` is empty after trim.
Common situations: Typos where the header name was deleted (`-H ": Bearer xyz"`), templated request files where the header-name variable was empty, or hand-edited header lines missing `Authorization:` etc.
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
- Empty header provided
- Empty query string provided
- Empty key in query string
- Empty --request-file file provided
- Invalid request: Missing head/body separator
AI-assisted analysis of epi052/feroxbuster@1f595dab5c (2026-09-13).
Data as JSON: /api/errors/dbf92764a518e0de.
Report an issue: GitHub.
Appendix: source
Thrown at src/config/utils.rs:316
/// or an error if the input is invalid.
///
/// # Errors
///
/// This function will return an error if:
/// * The input string is empty.
/// * The key part of the header string is empty (i.e., if the string starts with `":"`).
pub fn split_header(header: &str) -> Result<(String, String)> {
if header.is_empty() {
bail!("Empty header provided");
}
let mut split_val = header.split(':');
// explicitly take first split value as header's name
let name = split_val.next().unwrap().trim().to_string();
if name.is_empty() {
bail!("Empty header name provided");
}
// all other items in the iterator returned by split, when combined with the
// original split deliminator (:), make up the header's final value
let value = split_val.collect::<Vec<&str>>().join(":");
if value.starts_with(' ') && !value.starts_with(" ") {
// first character is a space and the second character isn't
// we can trim the leading space
let trimmed = value.trim_start();
Ok((name, trimmed.to_string()))
} else {
Ok((name, value))
}
}
/// Combines two `Cookie` header strings into a single, unified `Cookie` header string.
///View on GitHub (pinned to 1f595dab5c)