Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brave-mails-take.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cloudflare/local-explorer-ui": patch
---

Fix local explorer's sidebar header link to point to the correct `/cdn-cgi/explorer/` path rather than `/`.
11 changes: 11 additions & 0 deletions .changeset/c3-frameworks-update-12805.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"create-cloudflare": patch
---

Update dependencies of "create-cloudflare"

The following dependency versions have been updated:

| Dependency | From | To |
| --------------- | ------ | ------ |
| @angular/create | 21.2.0 | 21.2.1 |
11 changes: 11 additions & 0 deletions .changeset/c3-frameworks-update-12806.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"create-cloudflare": patch
---

Update dependencies of "create-cloudflare"

The following dependency versions have been updated:

| Dependency | From | To |
| ----------- | ------- | ------- |
| create-vike | 0.0.591 | 0.0.592 |
12 changes: 12 additions & 0 deletions .changeset/dependabot-update-12861.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"miniflare": patch
"wrangler": patch
---

Update dependencies of "miniflare", "wrangler"

The following dependency versions have been updated:

| Dependency | From | To |
| ---------- | ------------ | ------------ |
| workerd | 1.20260310.1 | 1.20260312.1 |
12 changes: 12 additions & 0 deletions .changeset/rude-steaks-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"miniflare": patch
---

Fix local explorer route matching to be more precise

Previously, the route matching used `startsWith("/cdn-cgi/explorer")` which would incorrectly match paths like `/cdn-cgi/explorerfoo` or `/cdn-cgi/explorereeeeee`, causing unexpected behavior. The route matching has been improved to only match:

- `/cdn-cgi/explorer` (exact match)
- `/cdn-cgi/explorer/` and any sub-paths (e.g., `/cdn-cgi/explorer/api/*`)

Paths that merely start with `/cdn-cgi/explorer` but aren't actually the explorer (like `/cdn-cgi/explorerfoo`) will now correctly fall through to the user worker.
4 changes: 2 additions & 2 deletions packages/create-cloudflare/src/frameworks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"create-astro": "4.13.2",
"create-analog": "2.3.1",
"@angular/create": "21.2.0",
"@angular/create": "21.2.1",
"create-docusaurus": "3.9.2",
"create-hono": "0.19.4",
"create-next-app": "15.5.6",
Expand All @@ -16,7 +16,7 @@
"create-rwsdk": "3.1.3",
"create-react-router": "7.13.1",
"create-solid": "0.6.13",
"create-vike": "0.0.591",
"create-vike": "0.0.592",
"create-vue": "3.22.0",
"create-waku": "0.12.5-1.0.0-alpha.5-0",
"@tanstack/create-start": "0.59.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/local-explorer-ui/src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function Sidebar({
<aside className="flex w-sidebar flex-col border-r border-border bg-bg-secondary">
<a
className="box-border flex min-h-16.75 items-center gap-2.5 p-4"
href="/"
href="/cdn-cgi/explorer/"
>
<CloudflareLogo className="shrink-0 text-primary" />
<div className="flex flex-col gap-px">
Expand Down
2 changes: 1 addition & 1 deletion packages/miniflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@cspotcode/source-map-support": "0.8.1",
"sharp": "^0.34.5",
"undici": "catalog:default",
"workerd": "1.20260310.1",
"workerd": "1.20260312.1",
"ws": "catalog:default",
"youch": "4.1.0-beta.10"
},
Expand Down
5 changes: 4 additions & 1 deletion packages/miniflare/src/workers/core/entry.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ export default <ExportedHandler<Env>>{

try {
if (env[CoreBindings.SERVICE_LOCAL_EXPLORER]) {
if (url.pathname.startsWith(LOCAL_EXPLORER_BASE_PATH)) {
if (
url.pathname === LOCAL_EXPLORER_BASE_PATH ||
url.pathname.startsWith(`${LOCAL_EXPLORER_BASE_PATH}/`)
) {
return await env[CoreBindings.SERVICE_LOCAL_EXPLORER].fetch(request);
}
}
Expand Down
29 changes: 29 additions & 0 deletions packages/miniflare/test/plugins/local-explorer/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,33 @@ describe("Local Explorer API validation", () => {
});
expect(status).toBe(403);
});

describe("routing", () => {
test("serves explorer UI at /cdn-cgi/explorer", async ({ expect }) => {
const res = await mf.dispatchFetch("http://localhost/cdn-cgi/explorer");
expect(res.status).toBe(200);
expect(res.headers.get("Content-Type")).toContain("text/html");

await res.arrayBuffer(); // Drain
});

test("serves explorer UI at /cdn-cgi/explorer/", async ({ expect }) => {
const res = await mf.dispatchFetch("http://localhost/cdn-cgi/explorer/");
expect(res.status).toBe(200);
expect(res.headers.get("Content-Type")).toContain("text/html");

await res.arrayBuffer(); // Drain
});

test("does not match paths that start with /cdn-cgi/explorer but are not the explorer", async ({
expect,
}) => {
// This should fall through to the user worker, not match the explorer
const res = await mf.dispatchFetch(
"http://localhost/cdn-cgi/explorerfoo"
);
expect(res.status).toBe(200);
expect(await res.text()).toBe("user worker");
});
});
});
2 changes: 1 addition & 1 deletion packages/wrangler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"miniflare": "workspace:*",
"path-to-regexp": "6.3.0",
"unenv": "2.0.0-rc.24",
"workerd": "1.20260310.1"
"workerd": "1.20260312.1"
},
"devDependencies": {
"@aws-sdk/client-s3": "^3.721.0",
Expand Down
Loading
Loading