From ab74263cbca53dd580faa4d86791746f8946fcd0 Mon Sep 17 00:00:00 2001 From: elbaro Date: Wed, 17 Apr 2024 03:25:35 +0900 Subject: [PATCH] Skip HEAD requests for Pypicloud with Private S3 (#3070) --- crates/uv-client/src/error.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/uv-client/src/error.rs b/crates/uv-client/src/error.rs index af69e27a0..2f88bdf54 100644 --- a/crates/uv-client/src/error.rs +++ b/crates/uv-client/src/error.rs @@ -77,6 +77,12 @@ impl Error { if status == reqwest::StatusCode::NOT_FOUND { return true; } + + // In some cases, registries (like PyPICloud) return a 403 for HEAD requests + // when they're not supported. Again, it's better to be lenient here. + if status == reqwest::StatusCode::FORBIDDEN { + return true; + } } }