Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 476 for etag (0.05 sec)

  1. internal/etag/etag.go

    func Multipart(etags ...ETag) ETag {
    	if len(etags) == 0 {
    		return nil
    	}
    
    	var n int64
    	h := md5.New()
    	for _, etag := range etags {
    		if !etag.IsMultipart() && !etag.IsEncrypted() {
    			h.Write(etag)
    			n++
    		}
    	}
    	etag := append(h.Sum(nil), '-')
    	return strconv.AppendInt(etag, n, 10)
    }
    
    // Set adds the ETag to the HTTP headers. It overwrites any
    // existing ETag entry.
    //
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Mar 10 21:09:36 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  2. internal/etag/reader.go

    	sum := r.md5.Sum(nil)
    	return ETag(sum)
    }
    
    // VerifyError is an error signaling that a
    // computed ETag does not match an expected
    // ETag.
    type VerifyError struct {
    	Expected ETag
    	Computed ETag
    }
    
    func (v VerifyError) Error() string {
    	return fmt.Sprintf("etag: expected ETag %q does not match computed ETag %q", v.Expected, v.Computed)
    }
    
    // UUIDHash - use uuid to make md5sum
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Jan 18 07:03:17 UTC 2024
    - 4.8K bytes
    - Viewed (0)
  3. cmd/object-handlers-common.go

    	// We must not use the http.Header().Set method here because some (broken)
    	// clients expect the ETag header key to be literally "ETag" - not "Etag" (case-sensitive).
    	// Therefore, we have to set the ETag directly as map entry.
    	if objInfo.ETag != "" && !delete {
    		w.Header()[xhttp.ETag] = []string{`"` + objInfo.ETag + `"`}
    	}
    
    	// Set the relevant version ID as part of the response header.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Sep 03 06:33:53 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  4. internal/etag/etag_test.go

    		if _, err := io.Copy(io.Discard, reader); err != nil {
    			t.Fatalf("Test %d: read failed: %v", i, err)
    		}
    		if ETag := reader.ETag(); !Equal(ETag, test.ETag) {
    			t.Fatalf("Test %d: ETag mismatch: got %q - want %q", i, ETag, test.ETag)
    		}
    	}
    }
    
    var multipartTests = []struct { // Test cases have been generated using AWS S3
    	ETags     []ETag
    	Multipart ETag
    }{
    	{
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 18 17:00:54 UTC 2023
    - 12.6K bytes
    - Viewed (0)
  5. cmd/object-api-putobject_test.go

    	// Complete multipart.
    	parts := []CompletePart{
    		{ETag: etag1, PartNumber: 1},
    		{ETag: etag2, PartNumber: 2},
    	}
    	_, err = obj.CompleteMultipartUpload(context.Background(), bucket, object, uploadID, parts, ObjectOptions{})
    	if err != nil {
    		// Failed to complete multipart upload, abort.
    		t.Fatalf("%s : %s", instanceType, err.Error())
    	}
    
    	for _, disk := range disks {
    		tmpMetaDir := path.Join(disk, minioMetaTmpBucket)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Feb 22 06:26:06 UTC 2024
    - 25.8K bytes
    - Viewed (0)
  6. cmd/erasure-healing-common.go

    	"context"
    	"slices"
    	"time"
    
    	"github.com/minio/madmin-go/v3"
    )
    
    func commonETags(etags []string) (etag string, maxima int) {
    	etagOccurrenceMap := make(map[string]int, len(etags))
    
    	// Ignore the uuid sentinel and count the rest.
    	for _, etag := range etags {
    		if etag == "" {
    			continue
    		}
    		etagOccurrenceMap[etag]++
    	}
    
    	maxima = 0 // Counter for remembering max occurrence of elements.
    	latest := ""
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Oct 31 22:10:24 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  7. cmd/encryption-v1_test.go

    		ETag:       "",
    		ShouldFail: true, // ETag prefix is not a valid hex value
    	},
    	{
    		ObjectKey:  [32]byte{},
    		ObjectInfo: ObjectInfo{ETag: "16516b396f0f4d4f2a0e7177557bec4-1-2"},
    		ETag:       "",
    		ShouldFail: true, // ETag contains multiple: -
    	},
    }
    
    func TestDecryptETag(t *testing.T) {
    	for i, test := range decryptETagTests {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Sep 24 04:17:08 UTC 2022
    - 19.9K bytes
    - Viewed (0)
  8. cmd/encryption-v1.go

    		}
    		if _, err := strconv.ParseInt(object.ETag[i+1:], 10, 32); err != nil {
    			return "", errObjectTampered
    		}
    		return object.ETag, nil
    	}
    
    	etag, err := hex.DecodeString(object.ETag)
    	if err != nil {
    		return "", err
    	}
    	etag, err = key.UnsealETag(etag)
    	if err != nil {
    		return "", err
    	}
    	return hex.EncodeToString(etag), nil
    }
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Oct 13 13:06:08 UTC 2024
    - 37.2K bytes
    - Viewed (0)
  9. internal/crypto/key.go

    	return partKey
    }
    
    // SealETag seals the etag using the object key.
    // It does not encrypt empty ETags because such ETags indicate
    // that the S3 client hasn't sent an ETag = MD5(object) and
    // the backend can pick an ETag value.
    func (key ObjectKey) SealETag(etag []byte) []byte {
    	if len(etag) == 0 { // don't encrypt empty ETag - only if client sent ETag = MD5(object)
    		return etag
    	}
    	var buffer bytes.Buffer
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Mar 19 20:28:10 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  10. cmd/object-api-utils_test.go

    		{[]CompletePart{{ETag: "wrong-md5-hash-string"}}, "0deb8cb07527b4b2669c861cb9653607-1", ""},
    
    		// Single CompletePart with valid MD5 hash string.
    		{[]CompletePart{{ETag: "cf1f738a5924e645913c984e0fe3d708"}}, "10dc1617fbcf0bd0858048cb96e6bd77-1", ""},
    
    		// Multiple CompletePart with valid MD5 hash string.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Aug 08 15:29:58 UTC 2024
    - 24.1K bytes
    - Viewed (0)
Back to top