mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Resolve the corner case of anonymous OCI registry access (#16669).
This commit is contained in:
parent
bbac5be4d3
commit
d73b0079e9
@ -705,7 +705,10 @@ class CurlGitHubPackagesDownloadStrategy < CurlDownloadStrategy
|
||||
meta[:headers] ||= []
|
||||
# GitHub Packages authorization header.
|
||||
# HOMEBREW_GITHUB_PACKAGES_AUTH set in brew.sh
|
||||
meta[:headers] << "Authorization: #{HOMEBREW_GITHUB_PACKAGES_AUTH}"
|
||||
# If using a private GHCR mirror with no Authentication set than do not add the header. In all other cases add it.
|
||||
if not (Homebrew::EnvConfig.artifact_domain.presence && !Homebrew::EnvConfig.docker_registry_basic_auth_token.presence && !Homebrew::EnvConfig.docker_registry_token.presence)
|
||||
meta[:headers] << "Authorization: #{HOMEBREW_GITHUB_PACKAGES_AUTH}"
|
||||
end
|
||||
super
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user