Skip to content

Commit

Permalink
Make regex for domain lookup have optional transform 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 authored Nov 16, 2023
1 parent e266560 commit 73ec69f
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 73ec69f

Please sign in to comment.