Skip to content

Commit 8c038d7

Browse files
committed
test: three pins that leaned on the old CORS default name their configuration
The runtime metrics pin configured '*' with credentials, which the transport now refuses at boot; it names the origin its preflight carries. Two http-conformance parity pins compared the doors' CORS headers by accident; both doors now run with CORS off, as the suite's other parity pins do. Claude-Session: https://claude.ai/code/session_01LmjU2x1faLZ39DVTFyVca6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8330356 commit 8c038d7

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎packages/qa/http-conformance/src/hono-approvals-act.conformance.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ async function bootKernel(opts: { selfHosted: boolean; approvals?: boolean }) {
9191
const kernel = new ObjectKernel({ logger: { level: 'silent' } } as any);
9292
liveKernels.push(kernel);
9393
await kernel.use(new ObjectQLPlugin());
94-
if (opts.selfHosted) await kernel.use(new HonoServerPlugin({ port: 0 }));
94+
// CORS off at both doors, as on the suite's other parity pins: it is transport
95+
// policy each door configures on its own, and not what these pins compare.
96+
if (opts.selfHosted) await kernel.use(new HonoServerPlugin({ port: 0, cors: false }));
9597
await kernel.use(new AutomationStub());
9698
if (opts.approvals !== false) await kernel.use(new ApprovalsServicePlugin());
9799
await kernel.bootstrap();
@@ -139,7 +141,7 @@ async function hostedDoor(opts: { approvals?: boolean } = {}) {
139141
let server: unknown;
140142
try { server = kernel.getService<unknown>('http.server'); } catch { server = undefined; }
141143
expect(server, 'the hosted shape owns no socket').toBeUndefined();
142-
const app = createHonoApp({ kernel: kernel as any, prefix: PREFIX });
144+
const app = createHonoApp({ kernel: kernel as any, prefix: PREFIX, cors: false });
143145
return {
144146
kernel,
145147
openWithTokens,

‎packages/qa/http-conformance/src/hono-webhooks-redeliver.conformance.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ async function bootKernel(opts: { selfHosted: boolean; webhooks?: boolean; guard
139139
const kernel = new LiteKernel({ logger: { level: 'silent' } } as any);
140140
liveKernels.push(kernel);
141141
const fixture = new FixturePlugin(opts.guardable !== false);
142-
if (opts.selfHosted) kernel.use(new HonoServerPlugin({ port: 0 }));
142+
// CORS off at both doors, as on the suite's other parity pins: it is transport
143+
// policy each door configures on its own, and not what these pins compare.
144+
if (opts.selfHosted) kernel.use(new HonoServerPlugin({ port: 0, cors: false }));
143145
kernel.use(fixture);
144146
if (opts.webhooks !== false) kernel.use(new WebhookOutboxPlugin());
145147
await kernel.bootstrap();
@@ -190,7 +192,7 @@ async function hostedDoor(opts: { webhooks?: boolean; guardable?: boolean } = {}
190192
let server: unknown;
191193
try { server = booted.kernel.getService<unknown>('http.server'); } catch { server = undefined; }
192194
expect(server, 'the hosted shape owns no socket').toBeUndefined();
193-
const app = createHonoApp({ kernel: booted.kernel as any, prefix: PREFIX });
195+
const app = createHonoApp({ kernel: booted.kernel as any, prefix: PREFIX, cors: false });
194196
return { ...booted, send: (init: RequestInit, path = PATH) => app.request(`http://tenant.example${path}`, init) };
195197
}
196198

‎packages/runtime/src/http-metrics-inbound-coverage.hono.integration.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,10 @@ describe('#9650 §4 — the transport seam that was ruled, and its edges', () =>
604604
kernel.use(
605605
new HonoServerPlugin({
606606
port: 0,
607-
cors: { enabled: true, origins: '*' },
607+
// The origin the preflight below carries, named: the CORS
608+
// built-in refuses `'*'` while credentials are on, and an
609+
// admitted preflight is the one it answers on the way in.
610+
cors: { enabled: true, origins: ['https://app.test'] },
608611
observability: { metrics },
609612
}),
610613
);

0 commit comments

Comments
 (0)