{"record":{"id":"6c3394e7c4c9a3ae","repo":"jdx/mise","slug":"unsupported-archive-format","errorCode":null,"errorMessage":"unsupported archive format","messagePattern":"unsupported archive format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/github_relay.rs","lineNumber":254,"sourceCode":"        }\n    }\n    let host = if p[0] == \"api\" {\n        \"api.github.com\"\n    } else {\n        \"github.com\"\n    };\n    let suffix = path.split_once('/').expect(\"validated path\").1;\n    let mut url = format!(\"https://{host}/{suffix}\");\n    let archive_repo = match p.as_slice() {\n        [\"api\", \"repos\", _, _, \"tarball\" | \"zipball\", ..] => Some(name.clone()),\n        [\"web\", _, _, \"archive\", rest @ ..] => {\n            let reference = rest.join(\"/\");\n            let (kind, reference) = if let Some(reference) = reference.strip_suffix(\".tar.gz\") {\n                (\"tarball\", reference)\n            } else if let Some(reference) = reference.strip_suffix(\".zip\") {\n                (\"zipball\", reference)\n            } else {\n                bail!(\"unsupported archive format\");\n            };\n            if reference.is_empty() {\n                bail!(\"missing archive reference\");\n            }\n            // The API supplies short-lived private archive links; credentials\n            // remain at the API origin and are never attached to that redirect.\n            url = format!(\"https://api.github.com/repos/{name}/{kind}/{reference}\");\n            Some(name)\n        }\n        _ => None,\n    };\n    if let Some(query) = query {\n        url.push('?');\n        url.push_str(query);\n    }\n    Ok(Target {\n        url,\n        git,","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/github_relay.rs#L236-L272","documentation":"For `web/OWNER/REPO/archive/...` requests, the relay rewrites the download to the corresponding GitHub API `tarball`/`zipball` endpoint. The final path segment must end in `.tar.gz` (mapped to `tarball`) or `.zip` (mapped to `zipball`); any other archive suffix is rejected. This ensures the relay only proxies the two archive formats GitHub's API provides.","triggerScenarios":"A client requests an archive URL ending in something other than `.tar.gz` or `.zip`, e.g. `/web/org/repo/archive/refs/tags/v1.0.tar.bz2`, `.tgz`, `.7z`, or no extension at all (`/archive/refs/tags/v1.0`).","commonSituations":"Tools defaulting to GitHub's codeload `.tgz` naming; users hand-writing archive URLs with `.tar` or `.zip.gz`; templated URLs that append the wrong extension for the chosen format.","solutions":["Use `.tar.gz` for a tarball or `.zip` for a zipball at the end of the archive path","Replace `.tgz` with `.tar.gz` (GitHub web archive URLs use `.tar.gz`, not `.tgz`)","If you need another format, download the `.tar.gz`/`.zip` and convert locally"],"exampleFix":"// before\nGET /web/org/repo/archive/refs/tags/v1.0.tgz\n// after\nGET /web/org/repo/archive/refs/tags/v1.0.tar.gz","handlingStrategy":"validation","validationCode":"fn archive_kind(url_path: &str) -> Option<&'static str> {\n    if url_path.ends_with(\".tar.gz\") { Some(\"tarball\") }\n    else if url_path.ends_with(\".zip\") { Some(\"zipball\") }\n    else { None }\n}\nassert_eq!(archive_kind(\"/web/o/r/archive/v1.0.tar.gz\"), Some(\"tarball\"));","typeGuard":null,"tryCatchPattern":"match authorize(&scope, method, path, query) {\n    Err(e) if e.to_string().contains(\"unsupported archive format\") => {\n        eprintln!(\"use .tar.gz or .zip suffix for archive downloads\");\n    }\n    Ok(t) => forward(t),\n    Err(e) => return Err(e),\n}","preventionTips":["Use exactly .tar.gz (not .tgz/.tar.bz2) or .zip in archive URLs","Match the extension to the format you actually want to download","Convert other formats locally after downloading a supported archive","Template URLs with the correct fixed extension rather than deriving it from input"],"tags":["github","relay","archive","allowlist","download"],"backgroundTag":"unsupported-operation","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}