Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for GetContentChecksum (0.07 sec)

  1. internal/hash/checksum_test.go

    			}
    
    			w := httptest.NewRecorder()
    			AddChecksumHeader(w, m)
    			gotChksm, err := GetContentChecksum(w.Result().Header)
    			if tt.wantErr {
    				if err == nil {
    					t.Fatalf("Expected error for %s, got none", tt.name)
    				}
    				return
    			}
    			if err != nil {
    				t.Fatalf("GetContentChecksum failed for %s: %v", tt.name, err)
    			}
    
    			if gotChksm == nil {
    				t.Fatalf("Got nil checksum for %s", tt.name)
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 22 14:15:21 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  2. internal/hash/checksum.go

    		if cksum == nil {
    			continue
    		}
    		if cksum.Valid() {
    			w.Header().Set(cksum.Type.Key(), v)
    		}
    	}
    }
    
    // GetContentChecksum returns content checksum.
    // Returns ErrInvalidChecksum if so.
    // Returns nil, nil if no checksum.
    func GetContentChecksum(h http.Header) (*Checksum, error) {
    	if trailing := h.Values(xhttp.AmzTrailer); len(trailing) > 0 {
    		var res *Checksum
    		for _, header := range trailing {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 22 14:15:21 UTC 2025
    - 18.3K bytes
    - Viewed (0)
  3. internal/hash/reader.go

    // Returns ErrInvalidChecksum if a problem with the checksum is found.
    func (r *Reader) AddChecksum(req *http.Request, ignoreValue bool) error {
    	cs, err := GetContentChecksum(req.Header)
    	if err != nil {
    		return ErrInvalidChecksum
    	}
    	if cs == nil {
    		return nil
    	}
    	r.contentHash = *cs
    	if cs.Type.Trailing() {
    		r.trailer = req.Trailer
    	}
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Wed Jun 25 15:08:54 UTC 2025
    - 11.8K bytes
    - Viewed (0)
  4. cmd/object-api-options.go

    				Bucket: bucket,
    				Object: object,
    				Err:    fmt.Errorf("Unable to parse %s, failed with %w", xhttp.MinIOSourceMTime, err),
    			}
    		}
    	}
    
    	opts.WantChecksum, err = hash.GetContentChecksum(r.Header)
    	if err != nil {
    		return opts, err
    	}
    	opts.MTime = mtime
    	opts.UserDefined = make(map[string]string)
    	// Transfer SSEC key in opts.EncryptFn
    	if crypto.SSEC.IsRequested(r.Header) {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 14.3K bytes
    - Viewed (0)
  5. cmd/utils.go

    		want, err := base64.StdEncoding.DecodeString(mdFive)
    		if err != nil {
    			return false
    		}
    		r.Body = hash.NewChecker(r.Body, md5.New(), want, r.ContentLength)
    		return true
    	}
    	cs, err := hash.GetContentChecksum(r.Header)
    	if err != nil {
    		return false
    	}
    	if cs == nil || !cs.Type.IsSet() {
    		return false
    	}
    	if cs.Valid() && !cs.Type.Trailing() {
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 33K bytes
    - Viewed (0)
  6. cmd/bucket-handlers.go

    		apiErr.Description = fmt.Sprintf("%s (%v)", apiErr.Description, errors.New("The file or text content is missing"))
    		writeErrorResponse(ctx, w, apiErr, r.URL)
    		return
    	}
    	checksum, err := hash.GetContentChecksum(formValues)
    	if err != nil {
    		apiErr := errorCodes.ToAPIErr(ErrMalformedPOSTRequest)
    		apiErr.Description = fmt.Sprintf("%s (%v)", apiErr.Description, fmt.Errorf("Invalid checksum: %w", err))
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Sun Sep 28 20:59:21 UTC 2025
    - 63.9K bytes
    - Viewed (0)
Back to top