summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-05-17 13:58:42 +0200
committerGitHub <noreply@github.com>2022-05-17 19:58:42 +0800
commit9ea9206406583f3402be2630c57133f810c460d2 (patch)
treefa12c950786c247d4b8cea9503d8e894c7e6b99d
parent6d54799bbcce3ccaa27e3660b4a47f1bee039601 (diff)
downloadgitea-9ea9206406583f3402be2630c57133f810c460d2.tar.gz
gitea-9ea9206406583f3402be2630c57133f810c460d2.zip
ContainerRegistry - removed Basic Auth header (#19735)
* Removed Basic Auth header. * Fixed test.
-rw-r--r--integrations/api_packages_container_test.go5
-rw-r--r--routers/api/packages/container/container.go1
2 files changed, 1 insertions, 5 deletions
diff --git a/integrations/api_packages_container_test.go b/integrations/api_packages_container_test.go
index a8f49423e2..2b5be9dd4c 100644
--- a/integrations/api_packages_container_test.go
+++ b/integrations/api_packages_container_test.go
@@ -66,10 +66,7 @@ func TestPackageContainer(t *testing.T) {
Token string `json:"token"`
}
- authenticate := []string{
- `Bearer realm="` + setting.AppURL + `v2/token"`,
- `Basic`,
- }
+ authenticate := []string{`Bearer realm="` + setting.AppURL + `v2/token"`}
t.Run("Anonymous", func(t *testing.T) {
defer PrintCurrentTest(t)()
diff --git a/routers/api/packages/container/container.go b/routers/api/packages/container/container.go
index 08b6b421b0..2a564b3446 100644
--- a/routers/api/packages/container/container.go
+++ b/routers/api/packages/container/container.go
@@ -113,7 +113,6 @@ func apiErrorDefined(ctx *context.Context, err *namedError) {
func ReqContainerAccess(ctx *context.Context) {
if ctx.Doer == nil {
ctx.Resp.Header().Add("WWW-Authenticate", `Bearer realm="`+setting.AppURL+`v2/token"`)
- ctx.Resp.Header().Add("WWW-Authenticate", `Basic`)
apiErrorDefined(ctx, errUnauthorized)
}
}