diff --git a/cmd/object-handlers-common.go b/cmd/object-handlers-common.go index e84fd26cab609..3feff7b68c06a 100644 --- a/cmd/object-handlers-common.go +++ b/cmd/object-handlers-common.go @@ -185,7 +185,7 @@ func checkPreconditionsPUT(ctx context.Context, w http.ResponseWriter, r *http.R if isETagEqual(objInfo.ETag, ifNoneMatchETagHeader) { // If the object ETag matches with the specified ETag. writeHeaders() - w.WriteHeader(http.StatusNotModified) + writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPreconditionFailed), r.URL) return true } } diff --git a/cmd/s3-zip-handlers.go b/cmd/s3-zip-handlers.go index 6cb2c892e153c..eabe9450c8521 100644 --- a/cmd/s3-zip-handlers.go +++ b/cmd/s3-zip-handlers.go @@ -22,7 +22,9 @@ import ( "context" "errors" "io" + "mime" "net/http" + "path/filepath" "sort" "strings" @@ -166,10 +168,11 @@ func (api objectAPIHandlers) getObjectInArchiveFileHandler(ctx context.Context, // New object info fileObjInfo := ObjectInfo{ - Bucket: bucket, - Name: object, - Size: int64(file.UncompressedSize64), - ModTime: zipObjInfo.ModTime, + Bucket: bucket, + Name: object, + Size: int64(file.UncompressedSize64), + ModTime: zipObjInfo.ModTime, + ContentType: mime.TypeByExtension(filepath.Ext(object)), } var rc io.ReadCloser