From d96481d7070850b149c5ab949023a685e6a6e584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20ma=CC=8Ase=CC=81n?= Date: Tue, 11 Apr 2023 18:15:39 +0200 Subject: [PATCH] add additional test for valueless field --- pkg/registry/auth/auth_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/registry/auth/auth_test.go b/pkg/registry/auth/auth_test.go index b655980..e276dda 100644 --- a/pkg/registry/auth/auth_test.go +++ b/pkg/registry/auth/auth_test.go @@ -86,6 +86,12 @@ var _ = Describe("the auth module", func() { Expect(err).NotTo(HaveOccurred()) Expect(res).NotTo(BeNil()) }) + It("should not crash when a field without a value is recieved", func() { + input := `bearer realm="https://ghcr.io/token",service="ghcr.io",scope="repository:user/image:pull",valuelesskey` + res, err := auth.GetAuthURL(input, "containrrr/watchtower") + Expect(err).NotTo(HaveOccurred()) + Expect(res).NotTo(BeNil()) + }) }) When("getting a challenge url", func() { It("should create a valid challenge url object based on the image ref supplied", func() {