Skip to content

Commit 9fd279f

Browse files
mvdanrogpeppe
authored andcommitted
ociserver: test how invalid tag list query parameters behave
This particular case ends up as an HTTP 500 "internal server error" rather than an HTTP 400 "bad request" as it should. To be fixed in the following commit. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I9ad01565c1781d4578900370b0927adc1160816a Reviewed-on: https://review.gerrithub.io/c/cue-labs/oci/+/1216081 TryBot-Result: CUE porcuepine <[email protected]> Reviewed-by: Roger Peppe <[email protected]>
1 parent 27e071d commit 9fd279f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ociregistry/ociserver/registry_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,13 @@ func TestCalls(t *testing.T) {
503503
WantCode: http.StatusNotFound,
504504
WantBody: `{"errors":[{"code":"NAME_UNKNOWN","message":"repository name not known to registry"}]}`,
505505
},
506+
{
507+
Description: "list_tags_bad_request",
508+
Method: "GET",
509+
URL: "/v2/foo/tags/list?n=INVALID",
510+
WantCode: http.StatusInternalServerError,
511+
WantBody: `{"errors":[{"code":"UNKNOWN","message":"n is not a valid integer: bad request"}]}`,
512+
},
506513
{
507514
Description: "list_repos",
508515
Manifests: map[string]string{"foo/manifests/latest": "foo", "bar/manifests/latest": "bar"},

0 commit comments

Comments
 (0)