Skip to content

Commit 9210810

Browse files
committed
Auto merge of #11286 - ehuss:410-gone, r=Eh2406
Fix 410 gone response handling This changes the sparse-registry support for the 410 "Gone" HTTP response code. This is out of sync with the [load function](https://github.com/rust-lang/cargo/blob/8adf1df292c20bd21f91effc6fbff1c19a514c89/src/cargo/sources/registry/http_remote.rs#L375) mentioned in the comment. I assume it is supposed to be 410 and not 401 since 401 is "Unauthorized", and that doesn't signify that the resource is "not found". r? `@arlosi`
2 parents 8adf1df + c8c6a96 commit 9210810

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cargo/sources/registry/http_remote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl<'cfg> HttpRegistry<'cfg> {
235235
result.with_context(|| format!("failed to download from `{}`", url))?;
236236
let code = handle.response_code()?;
237237
// Keep this list of expected status codes in sync with the codes handled in `load`
238-
if !matches!(code, 200 | 304 | 401 | 404 | 451) {
238+
if !matches!(code, 200 | 304 | 410 | 404 | 451) {
239239
let url = handle.effective_url()?.unwrap_or(&url);
240240
return Err(HttpNotSuccessful {
241241
code,

0 commit comments

Comments
 (0)