From 3e4b554f8d628f64ef0675096ecf927727640036 Mon Sep 17 00:00:00 2001 From: "weiyuan.yl" Date: Mon, 28 Dec 2015 11:28:01 +0800 Subject: [PATCH] In HEAD request for missing resource, only 404 NOT FOUND is returned Change-Id: I73caf67b59519e6f4f82f7d78f5d4fd4ad9affcd Signed-off-by: weiyuan.yl --- registry/storage/driver/oss/oss.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/storage/driver/oss/oss.go b/registry/storage/driver/oss/oss.go index 4dfe5675..590c6a53 100644 --- a/registry/storage/driver/oss/oss.go +++ b/registry/storage/driver/oss/oss.go @@ -754,7 +754,7 @@ func (d *driver) ossPath(path string) string { } func parseError(path string, err error) error { - if ossErr, ok := err.(*oss.Error); ok && ossErr.Code == "NoSuchKey" { + if ossErr, ok := err.(*oss.Error); ok && ossErr.StatusCode == 404 && (ossErr.Code == "NoSuchKey" || ossErr.Code == "") { return storagedriver.PathNotFoundError{Path: path} }