{"record":{"id":"773e285f59098ba5","repo":"astral-sh/uv","slug":"invalid-http-status-location-value-location","errorCode":null,"errorMessage":"Invalid HTTP {status} 'Location' value `{location}` relative to `{original_req_url}`: {err}","messagePattern":"Invalid HTTP (.+?) 'Location' value `(.+?)` relative to `(.+?)`: (.+?)","errorType":"http","errorClass":"reqwest_middleware::Error::Middleware","httpStatus":null,"severity":"error","filePath":"crates/uv-client/src/base_client.rs","lineNumber":1007,"sourceCode":"\n    let location = res\n        .headers()\n        .get(LOCATION)\n        .ok_or(reqwest_middleware::Error::Middleware(anyhow!(\n            \"Server returned redirect (HTTP {status}) without destination URL. This may indicate a server configuration issue\"\n        )))?\n        .to_str()\n        .map_err(|_| {\n            reqwest_middleware::Error::Middleware(anyhow!(\n                \"Invalid HTTP {status} 'Location' value: must only contain visible ascii characters\"\n            ))\n        })?;\n\n    let mut redirect_url = match DisplaySafeUrl::parse(location) {\n        Ok(url) => url,\n        // Per RFC 7231, URLs should be resolved against the request URL.\n        Err(DisplaySafeUrlError::Url(ParseError::RelativeUrlWithoutBase)) => original_req_url.join(location).map_err(|err| {\n            reqwest_middleware::Error::Middleware(anyhow!(\n                \"Invalid HTTP {status} 'Location' value `{location}` relative to `{original_req_url}`: {err}\"\n            ))\n        })?,\n        Err(err) => {\n            return Err(reqwest_middleware::Error::Middleware(anyhow!(\n                \"Invalid HTTP {status} 'Location' value `{location}`: {err}\"\n            )));\n        }\n    };\n    // Per RFC 7231, fragments must be propagated\n    if let Some(fragment) = original_req_url.fragment() {\n        redirect_url.set_fragment(Some(fragment));\n    }\n\n    // Ensure the URL is a valid HTTP URI.\n    if let Err(err) = redirect_url.as_str().parse::<http::Uri>() {\n        return Err(reqwest_middleware::Error::Middleware(anyhow!(\n            \"HTTP {status} 'Location' value `{redirect_url}` is not a valid HTTP URI: {err}\"","sourceCodeStart":989,"sourceCodeEnd":1025,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-client/src/base_client.rs#L989-L1025","documentation":"Error \"Invalid HTTP {status} 'Location' value `{location}` relative to `{original_req_url}`: {err}\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv-client/src/base_client.rs:1007 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}