package httpfetcher import ( "testing" "time" ) // TestJPEGXLContentType verifies that the fetcher accepts an upstream answer // of type image/jxl, and that the mock fetcher serves a .jxl file as // image/jxl. func TestJPEGXLContentType(t *testing.T) { t.Parallel() const jxlType = "image/jxl" f := New(&Config{ Timeout: 30 * time.Second, MaxResponseSize: 50 << 20, MaxConnectionsPerHost: 20, MaxConnections: 64, }) if !f.isAllowedContentType(jxlType) { t.Errorf("isAllowedContentType(%q) = false, want true", jxlType) } if got := detectContentTypeFromPath("images/photo.jxl"); got != jxlType { t.Errorf("detectContentTypeFromPath(photo.jxl) = %q, want %q", got, jxlType) } }