From 21504560e1f8435427be5a9a337e15c3d19feaf2 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Wed, 15 Apr 2015 17:55:15 -0700 Subject: [PATCH] Update final upload chunk api doc Updates description about content length and location Signed-off-by: Derek McGowan (github: dmcgowan) --- Makefile | 2 +- docs/spec/api.md | 6 +++--- registry/api/v2/descriptors.go | 14 +++++--------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index b1a26b869..974d0191d 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ ${PREFIX}/bin/dist: version/version.go $(shell find . -type f -name '*.go') @echo "+ $@" @go build -o $@ ${GO_LDFLAGS} ./cmd/dist -doc/spec/api.md: doc/spec/api.md.tmpl ${PREFIX}/bin/registry-api-descriptor-template +docs/spec/api.md: docs/spec/api.md.tmpl ${PREFIX}/bin/registry-api-descriptor-template ./bin/registry-api-descriptor-template $< > $@ vet: diff --git a/docs/spec/api.md b/docs/spec/api.md index 4512c22fe..032ddcf3c 100644 --- a/docs/spec/api.md +++ b/docs/spec/api.md @@ -2375,7 +2375,7 @@ The following parameters should be specified on the request: 204 No Content Location: Content-Range: - -Content-Length: +Content-Length: 0 Docker-Content-Digest: ``` @@ -2385,9 +2385,9 @@ The following headers will be returned with the response: |Name|Description| |----|-----------| -|`Location`|| +|`Location`|The canonical location of the blob for retrieval| |`Content-Range`|Range of bytes identifying the desired block of content represented by the body. Start must match the end of offset retrieved via status check. Note that this is a non-standard use of the `Content-Range` header.| -|`Content-Length`|Length of the chunk being uploaded, corresponding the length of the request body.| +|`Content-Length`|The `Content-Length` header must be zero and the body must be empty.| |`Docker-Content-Digest`|Digest of the targeted content for the request.| diff --git a/registry/api/v2/descriptors.go b/registry/api/v2/descriptors.go index 73f8b463e..833bff8b2 100644 --- a/registry/api/v2/descriptors.go +++ b/registry/api/v2/descriptors.go @@ -1190,9 +1190,10 @@ var routeDescriptors = []RouteDescriptor{ StatusCode: http.StatusNoContent, Headers: []ParameterDescriptor{ { - Name: "Location", - Type: "url", - Format: "", + Name: "Location", + Type: "url", + Format: "", + Description: "The canonical location of the blob for retrieval", }, { Name: "Content-Range", @@ -1200,12 +1201,7 @@ var routeDescriptors = []RouteDescriptor{ Format: "-", Description: "Range of bytes identifying the desired block of content represented by the body. Start must match the end of offset retrieved via status check. Note that this is a non-standard use of the `Content-Range` header.", }, - { - Name: "Content-Length", - Type: "integer", - Format: "", - Description: "Length of the chunk being uploaded, corresponding the length of the request body.", - }, + contentLengthZeroHeader, digestHeader, }, },