remove the cors test

This commit is contained in:
Girish Ramakrishnan
2026-02-17 17:15:13 +01:00
parent a51672f3ee
commit 113aba0897
2 changed files with 1 additions and 24 deletions

View File

@@ -79,28 +79,4 @@ describe('Server', function () {
expect(error).to.not.be(null);
});
});
describe('cors', function () {
before(server.start);
after(server.stop);
it('responds to OPTIONS', async function () {
const response = await superagent.options(SERVER_URL + '/api/v1/cloudron/status')
.set('Access-Control-Request-Method', 'GET')
.set('Access-Control-Request-Headers', 'accept, origin, x-superagented-with')
.set('Origin', 'http://localhost');
expect(response.headers['access-control-allow-methods']).to.be('GET, PUT, DELETE, POST, OPTIONS');
expect(response.headers['access-control-allow-credentials']).to.be('false');
expect(response.headers['access-control-allow-headers']).to.be('accept, origin, x-superagented-with'); // mirrored from superagent
expect(response.headers['access-control-allow-origin']).to.be('http://localhost'); // mirrors from superagent
});
it('does not crash for malformed origin', async function () {
const response = await superagent.options(SERVER_URL + '/api/v1/cloudron/status')
.set('Origin', 'foobar')
.ok(() => true);
expect(response.status).to.be(405);
});
});
});