Skip to content
Snippets Groups Projects
Unverified Commit 761cad43 authored by Diego Sampaio's avatar Diego Sampaio Committed by GitHub
Browse files

fix: CORS not being set for assets (#30237)

parent 8a59855f
No related branches found
No related tags found
No related merge requests found
---
'@rocket.chat/meteor': patch
---
Fix CORS headers not being set for assets
......@@ -79,7 +79,7 @@ WebApp.rawConnectHandlers.use((_req: http.IncomingMessage, res: http.ServerRespo
const _staticFilesMiddleware = WebAppInternals.staticFilesMiddleware;
// @ts-expect-error - accessing internal property of webapp
WebAppInternals._staticFilesMiddleware = function (
WebAppInternals.staticFilesMiddleware = function (
staticFiles: StaticFiles,
req: http.IncomingMessage,
res: http.ServerResponse,
......
import { describe, it } from 'mocha';
import { request } from '../../data/api-data.js';
describe('assets', function () {
this.retries(0);
it('should always have CORS headers for assets', async () => {
await request.get('/assets/favicon.svg').expect('Content-Type', 'image/svg+xml').expect('Access-Control-Allow-Origin', '*').expect(200);
await request
.get('/fonts/rocketchat.woff2')
.expect('Content-Type', 'font/woff2')
.expect('Access-Control-Allow-Origin', '*')
.expect(200);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment