{"record":{"id":"c2a4e99d0cddfd15","repo":"vectordotdev/vector","slug":"a-valid-http-1-uri-is-valid-as-an-http-uri","errorCode":null,"errorMessage":"a valid HTTP/1 URI is valid as an HTTP URI","messagePattern":"a valid HTTP/1 URI is valid as an HTTP URI","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/sinks/util/http_v1.rs","lineNumber":189,"sourceCode":"                        &response.http_response.body()[..response\n                            .http_response\n                            .body()\n                            .len()\n                            .min(super::http::MAX_ERROR_BODY_BYTES)],\n                    ),\n                );\n            }\n            status\n        },\n        retry_strategy,\n    )\n}\n\nfn protocol_endpoint(uri: &Uri) -> (String, String) {\n    let uri = uri\n        .to_string()\n        .parse::<http::Uri>()\n        .expect(\"a valid HTTP/1 URI is valid as an HTTP URI\");\n    super::uri::protocol_endpoint(uri)\n}\n","sourceCodeStart":171,"sourceCodeEnd":192,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sinks/util/http_v1.rs#L171-L192","documentation":"This panic fires in `protocol_endpoint` when re-parsing an already-valid `hyper::header::Uri` (HTTP/1 flavor) into the `http` crate's `Uri` fails. Both types represent HTTP URIs with the same validity rules, so a URI valid in one is valid in the other; the expect asserts that assumption.","triggerScenarios":"Any request processed by the http_v1 sink's `call` path passes through here; the panic only occurs if the crate-local Uri type accepts a string the `http::Uri` parser rejects (e.g. divergent grammar between crate versions).","commonSituations":"Could hypothetically appear after a crate version mismatch where hyper and http disagree on URI grammar (e.g. unusual schemes or authority forms).","solutions":["Report as a bug to Vector with the endpoint URI that triggered it.","Check for mismatched hyper/http crate versions in a custom Vector build.","Ensure the sink endpoint URL is a plain, well-formed http/https URL in configuration."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate endpoint URLs are plain http/https URLs in config.\nlet u = url::Url::parse(endpoint)?;\nassert!(matches!(u.scheme(), \"http\" | \"https\"));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use simple, well-formed endpoint URLs in sink configuration.","Avoid exotic URI forms (userinfo, odd schemes) for sink endpoints.","Keep hyper and http crate versions consistent in custom builds."],"tags":["rust","http","uri","panic"],"backgroundTag":"internal-invariant-violation","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}