Skip to content

Commit 4546783

Browse files
committed
test(http): assert exact host rejection response
1 parent 7dab95a commit 4546783

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

__tests__/integration/http-server.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,9 +1670,11 @@ async function runTests() {
16701670

16711671
envManager.restore();
16721672
assert.equal(res.status, 403);
1673-
assert.equal(res.body.error.code, -32000);
1674-
assert.equal(res.body.error.message, 'Invalid Host header');
1675-
assert.equal(res.text.includes('evil.example.com'), false);
1673+
assert.deepEqual(res.body, {
1674+
jsonrpc: '2.0',
1675+
error: { code: -32000, message: 'Invalid Host header' },
1676+
id: null,
1677+
});
16761678
}, results);
16771679

16781680
await testFunction('multiple sessions can initialize without "Already connected" error', async () => {

0 commit comments

Comments
 (0)