diff --git a/package-lock.json b/package-lock.json index 93e9792fc..136f41abd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,27 +38,27 @@ "cors": "^2.8.5", "create-react-class": "^15.7.0", "dedent": "^1.7.2", - "express": "^5.1.0", + "express": "^5.3.0", "express-async-handler": "^1.2.0", "express-static-gzip": "3.0.2", "fflate": "^0.8.3", "fs-extra": "^11.4.1", "hash-wasm": "^4.12.0", "idb-keyval": "^6.2.5", - "js-yaml": "^5.4.3", + "js-yaml": "^5.5.0", "jwt-simple": "^0.5.6", "less": "^4.9.1", "lodash": "^4.18.1", "marked-hbfm": "^1.0.1", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.31.0", - "mongoose": "^9.11.1", + "mongoose": "^9.11.2", "nanoid": "6.0.2", "nconf": "^0.13.0", - "node": "^26.11.1", - "prettier": "^3.9.9", - "react": "^19.3.0", - "react-dom": "^19.3.0", + "node": "^26.12.0", + "prettier": "^3.9.10", + "react": "^19.3.1", + "react-dom": "^19.3.1", "react-frame-component": "^5.3.2", "react-router": "^8.4.0", "sanitize-filename": "1.6.4", @@ -67,14 +67,14 @@ "devDependencies": { "@stylistic/stylelint-plugin": "^5.3.1", "babel-jest": "^30.5.2", - "babel-plugin-transform-import-meta": "^3.0.0", + "babel-plugin-transform-import-meta": "^3.1.0", "eslint": "9.7", "eslint-plugin-jest": "^29.15.1", "eslint-plugin-react": "^7.37.5", "globals": "^16.4.0", "jest": "^30.5.2", "jest-expect-message": "^1.1.3", - "jsdom": "^30.1.2", + "jsdom": "^30.1.3", "jsdom-global": "^3.0.2", "postcss-less": "^6.0.0", "stylelint": "^17.16.0", @@ -1703,9 +1703,9 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.20.3", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.3.tgz", - "integrity": "sha512-tlosUqb+3BbxCxZdu4tKeRghPFC+QM7q4X5YhKV2eCmPG+1r2F3f4AaSz5sCrFqUtX4Jh20VFTKecl16MgiV9g==", + "version": "6.20.4", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.20.4.tgz", + "integrity": "sha512-yF8RhOf2SXlg00+qtupzLhrglcas61boqaONiNcbPIebHCpJocpqTBA6dyrtUrQO47hqyTdeob/3XnYilT7TaQ==", "license": "MIT", "dependencies": { "@codemirror/language": "^6.0.0", @@ -2099,9 +2099,9 @@ "license": "MIT" }, "node_modules/@codemirror/view": { - "version": "6.43.14", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.14.tgz", - "integrity": "sha512-hC45YnmJNR1rz42OF57BLoQNFMV12/13drnvibDsR2quNDmldcb4WvYVV81hFQg56i9lcqQMEDqilhX2QDcGQQ==", + "version": "6.43.15", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.43.15.tgz", + "integrity": "sha512-HHsfpqFeHyXLs983pSRe38Xajs0vFWZQ2BuX0m7Ki8w3jZ5iD8cuR3lBz2/5/X53Dhf32SBHKh6rtSTB6tKeGw==", "license": "MIT", "dependencies": { "@codemirror/state": "^6.7.0", @@ -3522,9 +3522,9 @@ } }, "node_modules/@lezer/markdown": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@lezer/markdown/-/markdown-1.8.0.tgz", - "integrity": "sha512-X6w3A2NpyhdtGqTWRJB8gR4QDXBaFMbTOs780ZdZ15KKCfBXOQTKcB3Vr+W6tqJHVlealt53tLmHRvOqPTQgYA==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/@lezer/markdown/-/markdown-1.8.1.tgz", + "integrity": "sha512-M5YmEcKWO4mJ45Y1hECwqyu8cLv25EiXOK554PVOvDOWOP0olwelHHQUWr9sjF+d1bENVhy0nfJ8E57XZUTiXg==", "license": "MIT", "dependencies": { "@lezer/common": "^1.5.0", @@ -4688,13 +4688,13 @@ "license": "MIT" }, "node_modules/@typescript-eslint/project-service": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.71.2.tgz", - "integrity": "sha512-Pd68GsLVh5ZXlcEccFPdhSOvtHZ/2WU0XsA8zmXOS3F158lVlcTLhfQ6qvtL1RzbMie0Kp8xtbVwAg4nejKPHw==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.0.tgz", + "integrity": "sha512-bzHngBbmIgzj6TsTjVUCntGx6FFLgE7mPjpO0PzHycOaZHXqS43XnrkFIHRS16LLr/xO6FHSXG3GJFo/F4bSBQ==", "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.71.2", - "@typescript-eslint/types": "^8.71.2", + "@typescript-eslint/tsconfig-utils": "^8.72.0", + "@typescript-eslint/types": "^8.72.0", "debug": "^4.4.3" }, "engines": { @@ -4709,13 +4709,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.71.2.tgz", - "integrity": "sha512-YF4wgg5iUX5Obywoac27B56FhozMNFhdJSbh11H5GBAwmBtfyRhmgTQqW9tRNNmHDvsZ2CX6UGzoz+YfYn2Leg==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.0.tgz", + "integrity": "sha512-JewPyJOYcXBSAS7PIgufscHOwZqhTGyBRiQJhhuDln66tMchxvvt7nJ90JKKIoOelmdHA3kAQbm9cEUHc4JSEA==", "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.71.2", - "@typescript-eslint/visitor-keys": "8.71.2" + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/visitor-keys": "8.72.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4726,9 +4726,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.71.2.tgz", - "integrity": "sha512-jz49TAWokm/7yWD9/o837nYax9DyALxIPOImdImvVzo6canBCZYzin8zJyqNR5k1j9K1DE0bVvr0XYB+99uAdg==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.0.tgz", + "integrity": "sha512-0vbxCf7xLVPSjcOdm6eQbgViH8EDJ8xnl1laLT9yoqSz2YmcSfSg5Vdl0JUvZf6rcuJ0ZivJIuMD4edTg8obaA==", "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4742,9 +4742,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.71.2.tgz", - "integrity": "sha512-y5Ukl3oVp7e/VGxqIoEXoeb/Roj71PAJ4WG/N/RGj+eeDvKRLM15kGr9MijLbN0i03S52zxu31Z98E5gWChJKw==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.0.tgz", + "integrity": "sha512-Adfoy59kxNEjT5E5fnyrp7GpHYuWs8ONbdohu4ez6IU46qDq8LltG90tLmkucZB2uhYL8mqBjtXqGd8yhfjXqQ==", "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4755,15 +4755,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.71.2.tgz", - "integrity": "sha512-DgNOEsl4pdYzwSL+N/Cl33tX1Hlw3FvId73LnKXfq7jnrF2viOEn7X+P7RBkkSWCVm92gnWd28GIC5vJuLREeA==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.0.tgz", + "integrity": "sha512-gwLfFgWcw15tN2KXDCJvxEOQjPn+P3j/n3eSqkZ5sX4VpW9Cosodr+tWwBZRvJT3TcKx6HnPRGZMCNAiP1Xhug==", "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.71.2", - "@typescript-eslint/tsconfig-utils": "8.71.2", - "@typescript-eslint/types": "8.71.2", - "@typescript-eslint/visitor-keys": "8.71.2", + "@typescript-eslint/project-service": "8.72.0", + "@typescript-eslint/tsconfig-utils": "8.72.0", + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/visitor-keys": "8.72.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", @@ -4818,15 +4818,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.71.2.tgz", - "integrity": "sha512-RyKa1G1M9rKHDhrk+HJtiF1MvLD5Ux2JW3TSkzw+02pRALdpJb+QzG1Y5em+LvCgzGwgg8H7mBRFKljNz7ImPw==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.0.tgz", + "integrity": "sha512-0up3oArJZBYnzOaEXKo8DmI43QvMZyPoFEt9LWzRJcyl/RcJjfKKPebknN1VbTgXBf3M/KggUh5uUMdURLnseg==", "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.71.2", - "@typescript-eslint/types": "8.71.2", - "@typescript-eslint/typescript-estree": "8.71.2" + "@typescript-eslint/scope-manager": "8.72.0", + "@typescript-eslint/types": "8.72.0", + "@typescript-eslint/typescript-estree": "8.72.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4841,12 +4841,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.71.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.71.2.tgz", - "integrity": "sha512-zozlN0UA32bSG2zkKAgQyRYSbEISVoyU6vvkKYo2aSny74D8Jh4e+POkJ6Lk0dlezZi5x7TtD+88Xb06IB8nhg==", + "version": "8.72.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.0.tgz", + "integrity": "sha512-E2mroviasaWecDzTGiGMtuEguuLVOeRggnrIn93CJuxYJzQBHbyymlT08aVQydbBal5538o+JkBKXh2sRuCyIA==", "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.71.2", + "@typescript-eslint/types": "8.72.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -5934,9 +5934,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.11.29", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.29.tgz", - "integrity": "sha512-YeesxhUmR4h5y5V8KF8iBCqJb8YFrBJ++XBTeGcWIaQOYXGN19JM0FoiOjAhwuDoln8owMgXcWBmgHtYSkky2w==", + "version": "2.11.30", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.30.tgz", + "integrity": "sha512-YJs6Pz17RMNv8HoyKREtCY38E3BV1nPkWVmIb+XN1uHC1Vqt3KZCH/uJH9ZKRoiKb/icZ6tvehyee6RZNbFfRA==", "license": "Apache-2.0", "bin": { "baseline-browser-mapping": "dist/cli.cjs" @@ -8344,9 +8344,9 @@ } }, "node_modules/globby/node_modules/ignore": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.12.tgz", - "integrity": "sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==", + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.13.tgz", + "integrity": "sha512-2E8Q6rh+1RRSq/YdaGsNfXsEZy9FVqv6BSSrkmZJP7BnaoPnRfKL+YaofPvP+5rzdk144qSm6i4+hvPgUcbV4Q==", "dev": true, "license": "MIT", "engines": { @@ -14192,9 +14192,9 @@ } }, "node_modules/stylelint-config-recess-order": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recess-order/-/stylelint-config-recess-order-7.8.0.tgz", - "integrity": "sha512-ObYusdkXavm8ulgb5xvmU1l8wgCdveNYG12hOTUEdjS8bNhSRggl4or0mE0JaOnQz+Ve2xZemVpwqERCgJbntg==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/stylelint-config-recess-order/-/stylelint-config-recess-order-7.8.1.tgz", + "integrity": "sha512-hS1dWM7PMppWt/Quf51kJ6JaJV9QM7hSpJrgi6g9zAKBEte+vfqE6WQ5bXD5yU0j063QSZBwf6OmhAEfrWCrfQ==", "dev": true, "license": "ISC", "peerDependencies": { @@ -14266,9 +14266,9 @@ } }, "node_modules/stylelint/node_modules/ignore": { - "version": "7.0.12", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.12.tgz", - "integrity": "sha512-/8UvqAPU9DGTI9k4mxtf49U37Isfwr8Uts96+SBHIkFxPJnHS0Ew4f00sM4Scd8V8EjM0jUNtVDdv1kPdt35lg==", + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.13.tgz", + "integrity": "sha512-2E8Q6rh+1RRSq/YdaGsNfXsEZy9FVqv6BSSrkmZJP7BnaoPnRfKL+YaofPvP+5rzdk144qSm6i4+hvPgUcbV4Q==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 6f1269f97..f6dcaf2b9 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "test:api-unit:css": "jest \"server/.*.spec.js\" -t \"Get CSS\" --verbose", "test:api-unit:notifications": "jest \"server/.*.spec.js\" -t \"Notifications\" --verbose", "test:content-negotiation": "jest \"server/middleware/.*.spec.js\" --verbose", + "test:static-content": "jest \"tests/routes/static-content.test.js\" --verbose", "test:coverage": "jest --coverage --silent --runInBand", "test:dev": "jest --verbose --watch", "test:basic": "jest tests/markdown/basic.test.js --verbose", @@ -115,27 +116,27 @@ "cors": "^2.8.5", "create-react-class": "^15.7.0", "dedent": "^1.7.2", - "express": "^5.1.0", + "express": "^5.3.0", "express-async-handler": "^1.2.0", "express-static-gzip": "3.0.2", "fflate": "^0.8.3", "fs-extra": "^11.4.1", "hash-wasm": "^4.12.0", "idb-keyval": "^6.2.5", - "js-yaml": "^5.4.3", + "js-yaml": "^5.5.0", "jwt-simple": "^0.5.6", "less": "^4.9.1", "lodash": "^4.18.1", "marked-hbfm": "^1.0.1", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.31.0", - "mongoose": "^9.11.1", + "mongoose": "^9.11.2", "nanoid": "6.0.2", "nconf": "^0.13.0", - "node": "^26.11.1", - "prettier": "^3.9.9", - "react": "^19.3.0", - "react-dom": "^19.3.0", + "node": "^26.12.0", + "prettier": "^3.9.10", + "react": "^19.3.1", + "react-dom": "^19.3.1", "react-frame-component": "^5.3.2", "react-router": "^8.4.0", "sanitize-filename": "1.6.4", @@ -144,14 +145,14 @@ "devDependencies": { "@stylistic/stylelint-plugin": "^5.3.1", "babel-jest": "^30.5.2", - "babel-plugin-transform-import-meta": "^3.0.0", + "babel-plugin-transform-import-meta": "^3.1.0", "eslint": "9.7", "eslint-plugin-jest": "^29.15.1", "eslint-plugin-react": "^7.37.5", "globals": "^16.4.0", "jest": "^30.5.2", "jest-expect-message": "^1.1.3", - "jsdom": "^30.1.2", + "jsdom": "^30.1.3", "jsdom-global": "^3.0.2", "postcss-less": "^6.0.0", "stylelint": "^17.16.0", diff --git a/tests/routes/static-content.test.js b/tests/routes/static-content.test.js new file mode 100644 index 000000000..3d307ca00 --- /dev/null +++ b/tests/routes/static-content.test.js @@ -0,0 +1,24 @@ +import supertest from 'supertest'; +import createApp from '../../server/app.js'; + +let app; +let request; + +beforeAll(async ()=>{ + app = await createApp(); + request = supertest.agent(app).set('X-Forwarded-Proto', 'https'); +}); + +describe('Tests for static assets and cache settings', ()=>{ + it('Test regular CSS file', async ()=>{ + const results = await request.get('/fonts/fonts/fonts.css'); + expect(results.header['content-type']).toBe('text/css; charset=utf-8'); + expect(results.header['cache-control']).toBe('public, max-age: 43200, must-revalidate'); + }); + + it('Test regular font file', async ()=>{ + const results = await request.get('/fonts/fonts/open-sans-latin-400-normal.woff2'); + expect(results.header['content-type']).toBe('font/woff2'); + expect(results.header['cache-control']).toBe('public, max-age=2592000, must-revalidate'); + }); +});