Skip to content

Commit

Permalink
fix(cloudflare): use optional regex for transformation group #60
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Kane <m@mk.gg>
  • Loading branch information
davedbase and ascorbic committed Nov 16, 2023
1 parent e266560 commit 2800f41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { toUrl } from "../utils.ts";

const cloudflareRegex =
/https?:\/\/(?<host>[^\/]+)\/cdn-cgi\/image\/(?<transformations>[^\/]+)\/(?<path>.*)$/g;
/https?:\/\/(?<host>[^\/]+)\/cdn-cgi\/image\/(?<transformations>[^\/]+)?\/(?<path>.*)$/g;

const parseTransforms = (transformations: string) =>
Object.fromEntries(transformations.split(",").map((t) => t.split("=")));
Expand Down

0 comments on commit 2800f41

Please sign in to comment.