mirror of
https://github.com/distribution/distribution.git
synced 2025-09-13 13:49:00 +00:00
Merge pull request from GHSA-hqxw-f8mx-cpmw
Fix runaway allocation on /v2/_catalog
This commit is contained in:
@@ -134,6 +134,19 @@ var (
|
||||
},
|
||||
}
|
||||
|
||||
invalidPaginationResponseDescriptor = ResponseDescriptor{
|
||||
Name: "Invalid pagination number",
|
||||
Description: "The received parameter n was invalid in some way, as described by the error code. The client should resolve the issue and retry the request.",
|
||||
StatusCode: http.StatusBadRequest,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
ErrorCodePaginationNumberInvalid,
|
||||
},
|
||||
}
|
||||
|
||||
repositoryNotFoundResponseDescriptor = ResponseDescriptor{
|
||||
Name: "No Such Repository Error",
|
||||
StatusCode: http.StatusNotFound,
|
||||
@@ -489,18 +502,7 @@ var routeDescriptors = []RouteDescriptor{
|
||||
},
|
||||
},
|
||||
Failures: []ResponseDescriptor{
|
||||
{
|
||||
Name: "Invalid pagination number",
|
||||
Description: "The received parameter n was invalid in some way, as described by the error code. The client should resolve the issue and retry the request.",
|
||||
StatusCode: http.StatusBadRequest,
|
||||
Body: BodyDescriptor{
|
||||
ContentType: "application/json",
|
||||
Format: errorsBody,
|
||||
},
|
||||
ErrorCodes: []errcode.ErrorCode{
|
||||
ErrorCodePaginationNumberInvalid,
|
||||
},
|
||||
},
|
||||
invalidPaginationResponseDescriptor,
|
||||
unauthorizedResponseDescriptor,
|
||||
repositoryNotFoundResponseDescriptor,
|
||||
deniedResponseDescriptor,
|
||||
@@ -1589,6 +1591,9 @@ var routeDescriptors = []RouteDescriptor{
|
||||
},
|
||||
},
|
||||
},
|
||||
Failures: []ResponseDescriptor{
|
||||
invalidPaginationResponseDescriptor,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@@ -151,7 +151,8 @@ var (
|
||||
Value: "PAGINATION_NUMBER_INVALID",
|
||||
Message: "invalid number of results requested",
|
||||
Description: `Returned when the "n" parameter (number of results
|
||||
to return) is not an integer, or "n" is negative.`,
|
||||
to return) is not an integer, "n" is negative or "n" is bigger than
|
||||
the maximum allowed.`,
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
})
|
||||
)
|
||||
|
Reference in New Issue
Block a user