create-cloudflare 2.72.8 → 2.72.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.72.8",
3
+ "version": "2.72.10",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -31,7 +31,7 @@
31
31
  "@babel/parser": "^7.21.3",
32
32
  "@babel/types": "^7.21.4",
33
33
  "@clack/prompts": "^1.2.0",
34
- "@cloudflare/workers-types": "^5.20260915.1",
34
+ "@cloudflare/workers-types": "^5.20260921.1",
35
35
  "@types/command-exists": "^1.2.0",
36
36
  "@types/cross-spawn": "^6.0.2",
37
37
  "@types/deepmerge": "^2.2.0",
@@ -70,13 +70,13 @@
70
70
  "which-pm-runs": "^1.1.0",
71
71
  "wrap-ansi": "^9.0.0",
72
72
  "yargs": "^17.7.2",
73
- "@cloudflare/cli-shared-helpers": "0.1.31",
74
- "@cloudflare/shared-ast-primitives": "1.1.0",
75
- "@cloudflare/vite-plugin": "1.54.10",
73
+ "@cloudflare/cli-shared-helpers": "0.1.35",
76
74
  "@cloudflare/mock-npm-registry": "0.0.0",
75
+ "@cloudflare/shared-ast-primitives": "1.1.0",
76
+ "@cloudflare/vite-plugin": "1.57.0",
77
77
  "@cloudflare/workers-tsconfig": "0.0.0",
78
- "@cloudflare/workers-utils": "0.39.0",
79
- "wrangler": "4.132.0"
78
+ "@cloudflare/workers-utils": "0.41.0",
79
+ "wrangler": "4.136.0"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.0.0"
@@ -37,8 +37,8 @@ export default {
37
37
  return new Response(
38
38
  `Try making requests to:
39
39
  <ul>
40
- <li><code><a href="/redirect?redirectUrl=https://example.com/">/redirect?redirectUrl=https://example.com/</a></code>,</li>
41
- <li><code><a href="/proxy?modify&proxyUrl=https://example.com/">/proxy?modify&proxyUrl=https://example.com/</a></code>, or</li>
40
+ <li><code><a href="/redirect">/redirect</a></code>,</li>
41
+ <li><code><a href="/proxy?modify">/proxy?modify</a></code>, or</li>
42
42
  <li><code><a href="/api/todos">/api/todos</a></code></li>`,
43
43
  { headers: { 'Content-Type': 'text/html' } }
44
44
  );
@@ -1,16 +1,14 @@
1
+ // Keep the destination fixed to prevent this Worker from becoming an open proxy.
2
+ const PROXY_URL = 'https://example.com/';
3
+
1
4
  export default {
2
5
  async fetch(request, env, ctx) {
3
6
  const url = new URL(request.url);
4
7
 
5
- const proxyUrl = url.searchParams.get('proxyUrl'); // get a query param value (?proxyUrl=...)
6
- const modify = url.searchParams.has('modify'); // check if a query param is set (?proxyUrl=...&modify)
7
-
8
- if (!proxyUrl) {
9
- return new Response('Bad request: Missing `proxyUrl` query param', { status: 400 });
10
- }
8
+ const modify = url.searchParams.has('modify'); // check if a query param is set (?modify)
11
9
 
12
10
  // make subrequests with the global `fetch()` function
13
- let res = await fetch(proxyUrl, request);
11
+ let res = await fetch(PROXY_URL, request);
14
12
 
15
13
  // optionally, modify the respone
16
14
  if (modify) {
@@ -1,13 +1,9 @@
1
+ // Keep the destination fixed to prevent this Worker from becoming an open redirect.
2
+ const REDIRECT_URL = 'https://example.com/';
3
+
1
4
  export default {
2
5
  async fetch(request, env, ctx) {
3
- const url = new URL(request.url);
4
- const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
5
-
6
- if (!redirectUrl) {
7
- return new Response('Bad request: Missing `redirectUrl` query param', { status: 400 });
8
- }
9
-
10
6
  // The Response class has static methods to create common Response objects as a convenience
11
- return Response.redirect(redirectUrl);
7
+ return Response.redirect(REDIRECT_URL);
12
8
  },
13
9
  };
@@ -40,8 +40,8 @@ export default {
40
40
  return new Response(
41
41
  `Try making requests to:
42
42
  <ul>
43
- <li><code><a href="/redirect?redirectUrl=https://example.com/">/redirect?redirectUrl=https://example.com/</a></code>,</li>
44
- <li><code><a href="/proxy?modify&proxyUrl=https://example.com/">/proxy?modify&proxyUrl=https://example.com/</a></code>, or</li>
43
+ <li><code><a href="/redirect">/redirect</a></code>,</li>
44
+ <li><code><a href="/proxy?modify">/proxy?modify</a></code>, or</li>
45
45
  <li><code><a href="/api/todos">/api/todos</a></code></li>`,
46
46
  { headers: { 'Content-Type': 'text/html' } }
47
47
  );
@@ -1,16 +1,14 @@
1
+ // Keep the destination fixed to prevent this Worker from becoming an open proxy.
2
+ const PROXY_URL = 'https://example.com/';
3
+
1
4
  export default {
2
5
  async fetch(request, env, ctx): Promise<Response> {
3
6
  const url = new URL(request.url);
4
7
 
5
- const proxyUrl = url.searchParams.get('proxyUrl'); // get a query param value (?proxyUrl=...)
6
- const modify = url.searchParams.has('modify'); // check if a query param is set (?proxyUrl=...&modify)
7
-
8
- if (!proxyUrl) {
9
- return new Response('Bad request: Missing `proxyUrl` query param', { status: 400 });
10
- }
8
+ const modify = url.searchParams.has('modify'); // check if a query param is set (?modify)
11
9
 
12
10
  // make subrequests with the global `fetch()` function
13
- let res = await fetch(proxyUrl, request);
11
+ let res = await fetch(PROXY_URL, request);
14
12
 
15
13
  // optionally, modify the respone
16
14
  if (modify) {
@@ -1,13 +1,9 @@
1
+ // Keep the destination fixed to prevent this Worker from becoming an open redirect.
2
+ const REDIRECT_URL = 'https://example.com/';
3
+
1
4
  export default {
2
5
  async fetch(request, env, ctx): Promise<Response> {
3
- const url = new URL(request.url);
4
- const redirectUrl = url.searchParams.get('redirectUrl'); // get a query param value (?redirectUrl=...)
5
-
6
- if (!redirectUrl) {
7
- return new Response('Bad request: Missing `redirectUrl` query param', { status: 400 });
8
- }
9
-
10
6
  // The Response class has static methods to create common Response objects as a convenience
11
- return Response.redirect(redirectUrl);
7
+ return Response.redirect(REDIRECT_URL);
12
8
  },
13
9
  } satisfies ExportedHandler<Env>;