Merge pull request #3444 from sudo-bmitch/pr-api-http-status

This commit is contained in:
João Pereira 2021-06-30 12:59:49 +01:00 committed by GitHub
commit 26b0a79fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 11 deletions

View File

@ -3651,9 +3651,9 @@ The following parameters should be specified on the request:
``` ```
202 Accepted 202 Accepted
Content-Length: 0
Location: /v2/<name>/blobs/uploads/<uuid> Location: /v2/<name>/blobs/uploads/<uuid>
Range: 0-0 Range: 0-<offset>
Content-Length: 0
Docker-Upload-UUID: <uuid> Docker-Upload-UUID: <uuid>
``` ```
@ -3663,9 +3663,9 @@ The following headers will be returned with the response:
|Name|Description| |Name|Description|
|----|-----------| |----|-----------|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
|`Location`|The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.| |`Location`|The location of the created upload. Clients should use the contents verbatim to complete the upload, adding parameters where required.|
|`Range`|Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.| |`Range`|Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.|
|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.|
|`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.| |`Docker-Upload-UUID`|Identifies the docker upload uuid for the current request.|
@ -4379,7 +4379,7 @@ The following parameters should be specified on the request:
###### On Success: Data Accepted ###### On Success: Data Accepted
``` ```
204 No Content 202 Accepted
Location: /v2/<name>/blobs/uploads/<uuid> Location: /v2/<name>/blobs/uploads/<uuid>
Range: 0-<offset> Range: 0-<offset>
Content-Length: 0 Content-Length: 0
@ -4645,7 +4645,7 @@ The following parameters should be specified on the request:
###### On Success: Chunk Accepted ###### On Success: Chunk Accepted
``` ```
204 No Content 202 Accepted
Location: /v2/<name>/blobs/uploads/<uuid> Location: /v2/<name>/blobs/uploads/<uuid>
Range: 0-<offset> Range: 0-<offset>
Content-Length: 0 Content-Length: 0
@ -4925,7 +4925,7 @@ The following parameters should be specified on the request:
###### On Success: Upload Complete ###### On Success: Upload Complete
``` ```
204 No Content 201 Created
Location: <blob location> Location: <blob location>
Content-Range: <start of range>-<end of range, inclusive> Content-Range: <start of range>-<end of range, inclusive>
Content-Length: 0 Content-Length: 0

View File

@ -1043,7 +1043,6 @@ var routeDescriptors = []RouteDescriptor{
Description: "The upload has been created. The `Location` header must be used to complete the upload. The response should be identical to a `GET` request on the contents of the returned `Location` header.", Description: "The upload has been created. The `Location` header must be used to complete the upload. The response should be identical to a `GET` request on the contents of the returned `Location` header.",
StatusCode: http.StatusAccepted, StatusCode: http.StatusAccepted,
Headers: []ParameterDescriptor{ Headers: []ParameterDescriptor{
contentLengthZeroHeader,
{ {
Name: "Location", Name: "Location",
Type: "url", Type: "url",
@ -1052,9 +1051,10 @@ var routeDescriptors = []RouteDescriptor{
}, },
{ {
Name: "Range", Name: "Range",
Format: "0-0", Format: "0-<offset>",
Description: "Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.", Description: "Range header indicating the progress of the upload. When starting an upload, it will return an empty range, since no content has been received.",
}, },
contentLengthZeroHeader,
dockerUploadUUIDHeader, dockerUploadUUIDHeader,
}, },
}, },
@ -1237,7 +1237,7 @@ var routeDescriptors = []RouteDescriptor{
{ {
Name: "Data Accepted", Name: "Data Accepted",
Description: "The stream of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.", Description: "The stream of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.",
StatusCode: http.StatusNoContent, StatusCode: http.StatusAccepted,
Headers: []ParameterDescriptor{ Headers: []ParameterDescriptor{
{ {
Name: "Location", Name: "Location",
@ -1319,7 +1319,7 @@ var routeDescriptors = []RouteDescriptor{
{ {
Name: "Chunk Accepted", Name: "Chunk Accepted",
Description: "The chunk of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.", Description: "The chunk of data has been accepted and the current progress is available in the range header. The updated upload location is available in the `Location` header.",
StatusCode: http.StatusNoContent, StatusCode: http.StatusAccepted,
Headers: []ParameterDescriptor{ Headers: []ParameterDescriptor{
{ {
Name: "Location", Name: "Location",
@ -1413,7 +1413,7 @@ var routeDescriptors = []RouteDescriptor{
{ {
Name: "Upload Complete", Name: "Upload Complete",
Description: "The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header.", Description: "The upload has been completed and accepted by the registry. The canonical location will be available in the `Location` header.",
StatusCode: http.StatusNoContent, StatusCode: http.StatusCreated,
Headers: []ParameterDescriptor{ Headers: []ParameterDescriptor{
{ {
Name: "Location", Name: "Location",