Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for excludeForCompression (0.23 sec)

  1. cmd/object-api-utils_test.go

    					test.result, got)
    			}
    			if gErr != nil != test.err {
    				t.Errorf("IsCompressedOK: want error: %t, got error: %v", test.err, gErr)
    			}
    		})
    	}
    }
    
    // Tests excludeForCompression.
    func TestExcludeForCompression(t *testing.T) {
    	testCases := []struct {
    		object string
    		header http.Header
    		result bool
    	}{
    		{
    			object: "object.txt",
    			header: http.Header{
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 23.4K bytes
    - Viewed (0)
  2. cmd/object-api-utils.go

    	globalCompressConfigMu.Lock()
    	cfg := globalCompressConfig
    	globalCompressConfigMu.Unlock()
    
    	return !excludeForCompression(header, object, cfg)
    }
    
    // Eliminate the non-compressible objects.
    func excludeForCompression(header http.Header, object string, cfg compress.Config) bool {
    	objStr := object
    	contentType := header.Get(xhttp.ContentType)
    	if !cfg.Enabled {
    		return true
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 11 11:55:34 GMT 2024
    - 35.6K bytes
    - Viewed (1)
Back to top