Skip to content

Commit 36f589a

Browse files
committed
test(sveltekit): Send Content-Length with the tunnel test requests
The tunnel handler now answers a request without one with a 411.
1 parent 0f47fbb commit 36f589a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/sveltekit/test/server-common/handle.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,11 @@ describe('sentryHandle with the managed tunnel', () => {
158158

159159
it('answers tunnel requests without resolving the route', async () => {
160160
const tunnelPath = SentryCore.getTunnelPath(DSN)!;
161+
const body = SentryCore.serializeEnvelope(SentryCore.createEnvelope({ dsn: DSN }, [])) as string;
161162
const request = new Request(`http://localhost:3000${tunnelPath}`, {
162163
method: 'POST',
163-
body: SentryCore.serializeEnvelope(SentryCore.createEnvelope({ dsn: DSN }, [])) as BodyInit,
164+
body,
165+
headers: { 'content-length': String(body.length) },
164166
});
165167
const mockResolve = vi.fn();
166168

0 commit comments

Comments
 (0)