Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for canonicalizeETag (0.3 sec)

  1. internal/config/cache/remote.go

    }
    
    var etagRegex = regexp.MustCompile("\"*?([^\"]*?)\"*?$")
    
    // canonicalizeETag returns ETag with leading and trailing double-quotes removed,
    // if any present
    func canonicalizeETag(etag string) string {
    	return etagRegex.ReplaceAllString(etag, "$1")
    }
    
    // Init - populates the input values, initializes CondCheck
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Nov 22 21:46:17 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  2. cmd/object-handlers-common_test.go

    //
    // You should have received a copy of the GNU Affero General Public License
    // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    package cmd
    
    import (
    	"testing"
    )
    
    // Tests - canonicalizeETag()
    func TestCanonicalizeETag(t *testing.T) {
    	testCases := []struct {
    		etag              string
    		canonicalizedETag string
    	}{
    		{
    			etag:              "\"\"\"",
    			canonicalizedETag: "",
    		},
    		{
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 1.4K bytes
    - Viewed (0)
  3. cmd/object-handlers-common.go

    	// use mtime < t+1s instead of mtime <= t to check for unmodified.
    	return objTime.After(givenTime.Add(1 * time.Second))
    }
    
    // canonicalizeETag returns ETag with leading and trailing double-quotes removed,
    // if any present
    func canonicalizeETag(etag string) string {
    	return etagRegex.ReplaceAllString(etag, "$1")
    }
    
    // isETagEqual return true if the canonical representations of two ETag strings
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 15:31:51 UTC 2024
    - 14.6K bytes
    - Viewed (0)
  4. cmd/utils.go

    // GenETag - generate UUID based ETag
    func GenETag() string {
    	return ToS3ETag(getMD5Hash([]byte(mustGetUUID())))
    }
    
    // ToS3ETag - return checksum to ETag
    func ToS3ETag(etag string) string {
    	etag = canonicalizeETag(etag)
    
    	if !strings.HasSuffix(etag, "-1") {
    		// Tools like s3cmd uses ETag as checksum of data to validate.
    		// Append "-1" to indicate ETag is not a checksum.
    		etag += "-1"
    	}
    
    	return etag
    }
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed Jun 05 22:00:34 UTC 2024
    - 31.9K bytes
    - Viewed (0)
  5. cmd/object-api-utils.go

    // Create an s3 compatible MD5sum for complete multipart transaction.
    func getCompleteMultipartMD5(parts []CompletePart) string {
    	var finalMD5Bytes []byte
    	for _, part := range parts {
    		md5Bytes, err := hex.DecodeString(canonicalizeETag(part.ETag))
    		if err != nil {
    			finalMD5Bytes = append(finalMD5Bytes, []byte(part.ETag)...)
    		} else {
    			finalMD5Bytes = append(finalMD5Bytes, md5Bytes...)
    		}
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jun 11 03:13:30 UTC 2024
    - 36.3K bytes
    - Viewed (0)
  6. cmd/erasure-multipart.go

    				GotETag:    part.ETag,
    			}
    			return oi, invp
    		}
    		expPart := currentFI.Parts[partIdx]
    
    		// ensure that part ETag is canonicalized to strip off extraneous quotes
    		part.ETag = canonicalizeETag(part.ETag)
    		expETag := tryDecryptETag(objectEncryptionKey, expPart.ETag, kind == crypto.S3)
    		if expETag != part.ETag {
    			invp := InvalidPart{
    				PartNumber: part.PartNumber,
    				ExpETag:    expETag,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Jun 13 06:56:12 UTC 2024
    - 44.8K bytes
    - Viewed (0)
  7. cmd/server_test.go

    	c.Assert(response.StatusCode, http.StatusOK)
    	var parts []CompletePart
    	for _, part := range completeUploads.Parts {
    		part.ETag = canonicalizeETag(part.ETag)
    		parts = append(parts, part)
    	}
    	etag := getCompleteMultipartMD5(parts)
    	c.Assert(canonicalizeETag(response.Header.Get(xhttp.ETag)), etag)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 115.3K bytes
    - Viewed (0)
  8. cmd/object-handlers_test.go

    			t.Fatalf("Test failed to decode XML response: <ERROR> %v", err)
    		}
    
    		parts = append(parts, CompletePart{
    			PartNumber: partNumber,
    			ETag:       canonicalizeETag(resp.ETag),
    		})
    	}
    
    	result, err := obj.CompleteMultipartUpload(context.Background(), bucketName, testObject, uploadID, parts, ObjectOptions{})
    	if err != nil {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 10 15:50:49 UTC 2024
    - 161.9K bytes
    - Viewed (0)
Back to top