Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: animated modifier wasn't correctly being passed to autoDetectFormat #235

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ Change format to `webp` and keep other things same as source:

`/f_webp/static/buffalo.png`

Automatically convert to a preferred format (avif/webp/jpeg). Uses the browsers `accept` header to negotiate:

`/f_auto/static/buffalo.png`

Keep original format (`png`) and set width to `200`:

`/w_200/static/buffalo.png`
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
const acceptHeader = getRequestHeader(event, "accept") || "";
const autoFormat = autoDetectFormat(
acceptHeader,
!!(modifiers.a || modifiers.animated),
["a", "animated"].some((key) => key in modifiers),

Check warning on line 69 in src/server.ts

View check run for this annotation

Codecov / codecov/patch

src/server.ts#L69

Added line #L69 was not covered by tests
);
delete modifiers.f;
delete modifiers.format;
Expand Down