@astrojs/cloudflare 12.6.4 → 12.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,6 @@
1
+ import { imageConfig } from "astro:assets";
2
+ import { isRemotePath } from "@astrojs/internal-helpers/path";
3
+ import { isRemoteAllowed } from "astro/assets/utils";
1
4
  const prerender = false;
2
5
  const GET = (ctx) => {
3
6
  const href = ctx.url.searchParams.get("href");
@@ -7,6 +10,13 @@ const GET = (ctx) => {
7
10
  statusText: "Missing 'href' query parameter"
8
11
  });
9
12
  }
13
+ if (isRemotePath(href)) {
14
+ if (isRemoteAllowed(href, imageConfig) === false) {
15
+ return new Response("Forbidden", { status: 403 });
16
+ } else {
17
+ return Response.redirect(href, 302);
18
+ }
19
+ }
10
20
  return fetch(new URL(href, ctx.url.origin));
11
21
  };
12
22
  export {
package/dist/index.js CHANGED
@@ -110,12 +110,7 @@ function createIntegration(args) {
110
110
  "astro:routes:resolved": ({ routes }) => {
111
111
  _routes = routes;
112
112
  },
113
- "astro:config:done": ({ setAdapter, config, buildOutput, logger }) => {
114
- if (buildOutput === "static") {
115
- logger.warn(
116
- "[@astrojs/cloudflare] This adapter is intended to be used with server rendered pages, which this project does not contain any of. As such, this adapter is unnecessary."
117
- );
118
- }
113
+ "astro:config:done": ({ setAdapter, config, buildOutput }) => {
119
114
  _config = config;
120
115
  finalBuildOutput = buildOutput;
121
116
  let customWorkerEntryPoint;
@@ -130,7 +125,7 @@ function createIntegration(args) {
130
125
  setAdapter({
131
126
  name: "@astrojs/cloudflare",
132
127
  serverEntrypoint: customWorkerEntryPoint ?? "@astrojs/cloudflare/entrypoints/server.js",
133
- exports: args?.workerEntryPoint?.namedExports ? ["default", ...args.workerEntryPoint.namedExports] : ["default"],
128
+ exports: [.../* @__PURE__ */ new Set(["default", ...args?.workerEntryPoint?.namedExports ?? []])],
134
129
  adapterFeatures: {
135
130
  edgeMiddleware: false,
136
131
  buildOutput: "server"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to Cloudflare Workers/Pages",
4
- "version": "12.6.4",
4
+ "version": "12.6.6",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -33,19 +33,19 @@
33
33
  "@cloudflare/workers-types": "^4.20250507.0",
34
34
  "tinyglobby": "^0.2.13",
35
35
  "vite": "^6.3.5",
36
- "wrangler": "^4.14.1",
36
+ "wrangler": "4.14.1",
37
37
  "@astrojs/internal-helpers": "0.7.2",
38
38
  "@astrojs/underscore-redirects": "1.0.0"
39
39
  },
40
40
  "peerDependencies": {
41
- "astro": "^5.0.0"
41
+ "astro": "^5.7.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "cheerio": "1.0.0",
45
45
  "devalue": "^5.1.1",
46
46
  "execa": "^8.0.1",
47
47
  "rollup": "^4.40.2",
48
- "astro": "5.13.2",
48
+ "astro": "5.13.4",
49
49
  "astro-scripts": "0.0.14"
50
50
  },
51
51
  "publishConfig": {