Add failing tests for the format auto
check / check (push) Failing after 2s

Tests for #88, before the change:
the format chosen for each Accept header (AVIF-capable, WebP-only,
neither, wildcard only, absent, q=0 on AVIF, malformed), both image
routes serving an auto URL in the chosen format with Vary: Accept, also
on HEAD and 304, the signature covering auto rather than the chosen
format, each chosen format cached apart, and Vary: Accept next to the
CORS middleware's Vary: Origin. They do not compile yet: FormatAuto and
formatForAccept do not exist.

Model: opus-5-5
This commit is contained in:
2026-10-05 02:33:50 +00:00
parent 01823d27db
commit 5ff5caad6f
3 changed files with 373 additions and 0 deletions
@@ -95,6 +95,14 @@ func TestParseImageURL(t *testing.T) {
Size: Size{Width: 200, Height: 200}, Format: FormatGIF,
},
},
{
name: "auto format",
input: "/v1/image/example.com/photo.jpg/200x200.auto",
want: &ParsedURL{
Host: testHostExample, Path: "/photo.jpg",
Size: Size{Width: 200, Height: 200}, Format: FormatAuto,
},
},
}
for _, tt := range tests {