Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for isHTTPHeaderSizeTooLarge (0.13 sec)

  1. cmd/generic-handlers.go

    			return false
    		}
    		if stringsHasPrefixFold(key, ReservedMetadataPrefix) {
    			return true
    		}
    	}
    	return false
    }
    
    // isHTTPHeaderSizeTooLarge returns true if the provided
    // header is larger than 8 KB or the user-defined metadata
    // is larger than 2 KB.
    func isHTTPHeaderSizeTooLarge(header http.Header) bool {
    	var size, usersize int
    	for key := range header {
    		length := len(key) + len(header.Get(key))
    		size += length
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 29 18:10:04 UTC 2024
    - 20.5K bytes
    - Viewed (0)
  2. cmd/generic-handlers_test.go

    		header.Set(userMetadataKeyPrefixes[0]+strconv.Itoa(i), "")
    	}
    	return header
    }
    
    func TestIsHTTPHeaderSizeTooLarge(t *testing.T) {
    	for i, test := range isHTTPHeaderSizeTooLargeTests {
    		if res := isHTTPHeaderSizeTooLarge(test.header); res != test.shouldFail {
    			t.Errorf("Test %d: Expected %v got %v", i, res, test.shouldFail)
    		}
    	}
    }
    
    var containsReservedMetadataTests = []struct {
    	header     http.Header
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 29 18:10:04 UTC 2024
    - 5.5K bytes
    - Viewed (0)
Back to top