From bb300231d04ec749818a5640b14d03790390c1ac Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 12 Dec 2014 13:55:14 -0800 Subject: [PATCH] Allow variadic url values for BuildBlobUploadURL URL values may be required to complete an upload in a single POST request, which may include digest and size. This is not implemented in the server side, yet, but is part of the HTTP API specification. --- api/v2/urls.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/v2/urls.go b/api/v2/urls.go index 15d65484..72f44299 100644 --- a/api/v2/urls.go +++ b/api/v2/urls.go @@ -101,7 +101,7 @@ func (ub *URLBuilder) BuildBlobURL(name string, dgst digest.Digest) (string, err // BuildBlobUploadURL constructs a url to begin a blob upload in the // repository identified by name. -func (ub *URLBuilder) BuildBlobUploadURL(name string) (string, error) { +func (ub *URLBuilder) BuildBlobUploadURL(name string, values ...url.Values) (string, error) { route := ub.cloneRoute(RouteNameBlobUpload) uploadURL, err := route.URL("name", name) @@ -109,7 +109,7 @@ func (ub *URLBuilder) BuildBlobUploadURL(name string) (string, error) { return "", err } - return uploadURL.String(), nil + return appendValuesURL(uploadURL, values...).String(), nil } // BuildBlobUploadChunkURL constructs a url for the upload identified by uuid,