package httpfetcher import "testing" // TestJPEGXLContentType verifies that the fetcher accepts an upstream answer // of type image/jxl by default, and that the mock fetcher serves a .jxl file // as image/jxl. func TestJPEGXLContentType(t *testing.T) { t.Parallel() const jxlType = "image/jxl" if !New(DefaultConfig()).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) } }