We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eefd617 commit 333a90dCopy full SHA for 333a90d
1 file changed
src/providers/cloudflare.ts
@@ -114,9 +114,15 @@ export const generate: URLGenerator<"cloudflare"> = (
114
) => {
115
const modifiers = operationsGenerator(operations);
116
const url = toUrl(options?.domain ? `https://${options.domain}` : "/");
117
- url.pathname = `/cdn-cgi/image/${modifiers}/${
118
- stripLeadingSlash(src.toString())
119
- }`;
+
+ const srcStr = src.toString();
+ let pathSuffix = stripLeadingSlash(srcStr);
120
121
+ if (srcStr.startsWith("http") && srcStr.includes("?")) {
122
+ pathSuffix = encodeURIComponent(srcStr);
123
+ }
124
125
+ url.pathname = `/cdn-cgi/image/${modifiers}/${pathSuffix}`;
126
return toCanonicalUrlString(url);
127
};
128
0 commit comments