working commit
This commit is contained in:
+9
-8
@@ -13,7 +13,7 @@ func (hand *Handler) DumpHeaders(message string, rctx *router.Context) {
|
||||
hand.logg.Debugf("%s:\n%s\n", message, string(yamlData))
|
||||
}
|
||||
|
||||
// 1 HEAD /v2/<name>/blobs/<digest> 200 404
|
||||
// HEAD /v2/<name>/blobs/<digest> 200 404
|
||||
func (hand *Handler) BlobExists(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
digest, _ := rctx.GetSubpath("digest")
|
||||
@@ -34,7 +34,7 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// 2 POST /v2/<name>/blobs/uploads/ 202 404
|
||||
// POST /v2/<name>/blobs/uploads/ 202 404
|
||||
func (hand *Handler) PostUpload(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
digest := rctx.GetQuery("digest")
|
||||
@@ -63,10 +63,10 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
|
||||
// POST /v2/<name>/blobs/uploads/?digest=<digest> 201/202 404/400
|
||||
// POST /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_name> 201 404
|
||||
|
||||
// 3 PATCH /v2/<name>/blobs/uploads/<reference> 202 404/416
|
||||
// PATCH /v2/<name>/blobs/uploads/<reference> 202 404/416
|
||||
func (hand *Handler) PatchUpload(rctx *router.Context) {
|
||||
|
||||
hand.DumpHeaders("PatchUpload headers", rctx)
|
||||
//hand.DumpHeaders("PatchUpload headers", rctx)
|
||||
|
||||
contentLength := rctx.GetHeader("Content-Length")
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
@@ -90,15 +90,16 @@ func (hand *Handler) PatchUpload(rctx *router.Context) {
|
||||
hand.logg.Errorf("PatchUpload error: %v", err)
|
||||
}
|
||||
rctx.SetHeader("Location", res.Location)
|
||||
rctx.SetHeader("Range", res.Range)
|
||||
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// 4 PUT /v2/<name>/blobs/uploads/<reference>?digest=<digest> 202 404/416
|
||||
//
|
||||
// PUT /v2/<name>/uploads/<reference>?digest=<digest> 202 404/416
|
||||
// PUT /v2/<name>/blobs/uploads/<reference>?digest=<digest> 202 404/416
|
||||
// PUT /v2/<name>/uploads/<reference>?digest=<digest> 202 404/416
|
||||
func (hand *Handler) PutUpload(rctx *router.Context) {
|
||||
|
||||
hand.DumpHeaders("PutUpload headers", rctx)
|
||||
//hand.DumpHeaders("PutUpload headers", rctx)
|
||||
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
contentLength := rctx.GetHeader("Content-Length")
|
||||
|
||||
Reference in New Issue
Block a user