add etag only for PUT or large chunked uploads

This commit is contained in:
Chris Lu
2020-04-08 09:13:26 -07:00
parent ec2eb8bc48
commit dc08e4098f
3 changed files with 20 additions and 5 deletions

View File

@@ -166,3 +166,11 @@ func setEtag(w http.ResponseWriter, etag string) {
}
}
}
func getEtag(resp *http.Response) (etag string){
etag = resp.Header.Get("ETag")
if strings.HasPrefix(etag, "\"") && strings.HasSuffix(etag, "\""){
return etag[1:len(etag)-1]
}
return
}