From 2958099efc27e3b33055042b8b1a60a46c051fd6 Mon Sep 17 00:00:00 2001 From: lewzylu <327874225@qq.com> Date: Tue, 15 May 2018 16:24:48 +0800 Subject: [PATCH] fix headobject --- object.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/object.go b/object.go index 901e2be..8879dc6 100644 --- a/object.go +++ b/object.go @@ -169,7 +169,7 @@ func (s *ObjectService) Head(ctx context.Context, name string, opt *ObjectHeadOp optHeader: opt, } resp, err := s.client.send(ctx, &sendOpt) - if resp.Header["X-Cos-Object-Type"][0] == "appendable" { + if (resp.Header["X-Cos-Object-Type"] != nil && resp.Header["X-Cos-Object-Type"][0] == "appendable") { resp.Header.Add("x-cos-next-append-position",resp.Header["Content-Length"][0]) }