Skip to content

Commit d56dab0

Browse files
Be explicit that now Www-Authenticate header should be present
Co-authored-by: Stefan Majewsky <stefan.majewsky@sap.com>
1 parent 1d9030f commit d56dab0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/api/registry/replication_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,11 @@ func TestReplicationFailingFromGHCRio(t *testing.T) {
578578
Path: "/v2/test1/foo/manifests/latest",
579579
Header: map[string]string{"Authorization": "Bearer " + s1.GetToken(t, "repository:test1/foo:pull")},
580580
ExpectStatus: http.StatusUnauthorized,
581-
ExpectHeader: test.VersionHeader,
581+
ExpectHeader: map[string]string{
582+
test.VersionHeaderKey: test.VersionHeaderValue,
583+
// even though we return 401, no Www-Authenticate header shall be rendered because would be futile for the user performing this request to authenticate
584+
"Www-Authenticate": "",
585+
},
582586
ExpectBody: test.ErrorCode(keppel.ErrDenied),
583587
}.Check(t, s1.Handler)
584588
})

0 commit comments

Comments
 (0)