We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a010a4 commit 097e186Copy full SHA for 097e186
builder/src/build/build-worker/templates/worker.ts
@@ -36,12 +36,13 @@ export default {
36
const url = new URL(request.url);
37
38
if (url.pathname === "/_next/image") {
39
- // TODO: not implemented
40
- return fetch(
+ let imageUrl =
41
url.searchParams.get("url") ??
42
- "https://developers.cloudflare.com/_astro/logo.BU9hiExz.svg",
43
- { cf: { cacheEverything: true } } as any
44
- );
+ "https://developers.cloudflare.com/_astro/logo.BU9hiExz.svg";
+ if (imageUrl.startsWith("/")) {
+ imageUrl = new URL(imageUrl, request.url).href;
+ }
45
+ return fetch(imageUrl, { cf: { cacheEverything: true } } as any);
46
}
47
48
const resBody = new TransformStream();
0 commit comments