mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 09:35:39 +00:00
253a126888
Deleted the obsolete build workflow for BetterDesk and made adjustments to the CI configurations across multiple workflows. This includes changing permissions from write to read in the release-client and secret-scan workflows, updating the Node.js setup in the web-nodejs CI, and enhancing the rate limiting for RdClient pages. Additionally, improved the handling of return URLs in the auth middleware and added new utility functions for better security and logging.
27 lines
896 B
JavaScript
27 lines
896 B
JavaScript
/**
|
|
* BetterDesk Console - Font Service Tests
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
const fontService = require('../services/fontService');
|
|
|
|
describe('fontService security helpers', () => {
|
|
it('escapes CSS string metacharacters in font families', () => {
|
|
const escaped = fontService.escapeCssString("Bad');}\nbody{color:red}\\Font");
|
|
|
|
expect(escaped).toContain("\\'");
|
|
expect(escaped).toContain('\\a ');
|
|
expect(escaped).toContain('\\\\');
|
|
expect(escaped).not.toContain('\n');
|
|
});
|
|
|
|
it('uses escaped font families in generated branding CSS', () => {
|
|
const css = fontService.generateFontCss("Heading');}\nbody{color:red}", "Body\\Font");
|
|
|
|
expect(css).toContain("--font-heading: 'Heading\\');}\\a body{color:red}'");
|
|
expect(css).toContain("--font-family: 'Body\\\\Font'");
|
|
expect(css).not.toContain('\nbody{color:red}');
|
|
});
|
|
});
|