Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestDetectContentType (0.13 sec)

  1. src/net/http/sniff_test.go

    	{"Incorrect RAR v1.5-v4.0", []byte("Rar \x1A\x07\x00"), "application/octet-stream"},
    	{"Incorrect RAR v5+", []byte("Rar \x1A\x07\x01\x00"), "application/octet-stream"},
    }
    
    func TestDetectContentType(t *testing.T) {
    	for _, tt := range sniffTests {
    		ct := DetectContentType(tt.data)
    		if ct != tt.contentType {
    			t.Errorf("%v: DetectContentType = %q, want %q", tt.desc, ct, tt.contentType)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 07 16:53:14 UTC 2022
    - 9.6K bytes
    - Viewed (0)
Back to top