{"record":{"id":"1b30b050dbaa7522","repo":"epi052/feroxbuster","slug":"invalid-request-missing-host-header-and-request-line-uri-isn","errorCode":null,"errorMessage":"Invalid request: Missing Host header and request line URI isn't a full URL","messagePattern":"Invalid request: Missing Host header and request line URI isn't a full URL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config/utils.rs","lineNumber":594,"sourceCode":"        });\n\n        url.set_query(None);\n        url.set_fragment(None);\n\n        config.target_url = url.to_string();\n        config.scope.push(url);\n    } else {\n        // uri in request line is not a valid URL, so it's most likely a path/relative url\n        // we need to combine it with the host header\n        for (key, value) in &config.headers {\n            if key.to_lowercase() == \"host\" {\n                config.target_url = format!(\"{}://{value}{uri}\", config.protocol);\n                break;\n            }\n        }\n\n        if config.target_url.is_empty() {\n            bail!(\"Invalid request: Missing Host header and request line URI isn't a full URL\");\n        }\n\n        if let Ok(url) = parse_url_with_raw_path(&config.target_url) {\n            config.scope.push(url);\n        } else {\n            bail!(\n                \"Invalid request: Could not parse target URL {}\",\n                config.target_url\n            );\n        }\n\n        // need to parse queries from the uri, if any are present\n        let mut uri_parts = uri.splitn(2, '?');\n\n        // skip the path\n        uri_parts.next();\n\n        if let Some(queries) = uri_parts.next() {","sourceCodeStart":576,"sourceCodeEnd":612,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/config/utils.rs#L576-L612","documentation":"Thrown by parse_request_file when no Host header was found and the request-line URI is a relative path, so a full target URL cannot be constructed. The library needs scheme://host/path to send the request and adds the URL to the scan scope.","triggerScenarios":"A request file with a relative URI like 'GET /api HTTP/1.1' but missing the 'Host:' header, and no --url flag providing a target; config.target_url remains empty after scanning head parts for a host.","commonSituations":"Users stripping the Host header when hand-crafting requests; using HTTP/2-style absolute-less requests in a raw HTTP/1.1 file; forgetting that the tool needs an absolute target when the request file lacks one.","solutions":["Add a 'Host: example.com' header to the request file","Or pass a full target URL via --url/-u so target_url is not empty","Or make the request-line URI an absolute URL: 'GET https://example.com/path HTTP/1.1'"],"exampleFix":"// before\n\"GET /api HTTP/1.1\\nAccept: */*\"\n// after\n\"GET /api HTTP/1.1\\nHost: example.com\\nAccept: */*\"","handlingStrategy":"validation","validationCode":"fn request_is_resolvable(raw: &str) -> Result<(), String> {\n    let head = raw.lines().take_while(|l| !l.is_empty());\n    let has_host = head.any(|l| l.to_ascii_lowercase().starts_with(\"host:\"));\n    let line = raw.lines().next().unwrap_or(\"\");\n    let uri = line.split_whitespace().nth(1).unwrap_or(\"\");\n    let absolute = uri.starts_with(\"http://\") || uri.starts_with(\"https://\");\n    if has_host || absolute { Ok(()) } else {\n        Err(\"need a Host header or absolute URI in the request line\".into())\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a Host header in raw request files","Or supply the target via --url/-u on the command line","Never strip Host headers from exported requests"],"tags":["http","request-parsing","url"],"backgroundTag":"invalid-url","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"}