ep_helmet 11.0.16 → 11.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,10 @@ jobs:
26
26
  with:
27
27
  repository: ether/etherpad-lite
28
28
  path: etherpad-lite
29
+ - uses: actions/setup-node@v4
30
+ name: Install Node.js
31
+ with:
32
+ node-version: 22
29
33
  - uses: pnpm/action-setup@v6
30
34
  name: Install pnpm
31
35
  with:
@@ -16,6 +16,10 @@ jobs:
16
16
  with:
17
17
  repository: ether/etherpad-lite
18
18
  path: etherpad-lite
19
+ - uses: actions/setup-node@v4
20
+ name: Install Node.js
21
+ with:
22
+ node-version: 22
19
23
  - uses: pnpm/action-setup@v6
20
24
  name: Install pnpm
21
25
  with:
@@ -5,7 +5,13 @@ const crypto = require('crypto');
5
5
  const settings = require('ep_etherpad-lite/node/utils/Settings');
6
6
 
7
7
  exports.expressConfigure = (hookName, app, cb) => {
8
- app.app.use(helmet());
8
+ // Disable helmet's default Content-Security-Policy so the plugin
9
+ // doesn't accidentally lock down a working Etherpad install. The
10
+ // optional settings.ep_helmet.csp block below is the documented way
11
+ // for operators to opt in. With the default in place, strict
12
+ // 'script-src self' broke every page that relied on inline scripts
13
+ // or runtime eval (notably Playwright's waitForFunction in tests).
14
+ app.app.use(helmet({contentSecurityPolicy: false}));
9
15
 
10
16
  if (settings.ep_helmet) {
11
17
  console.debug('Using config from Helmet. ', settings.ep_helmet);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "Adds Security headers to Etherpad Express responses, including CSP(content security policy), and x-frame-origin, useful for if you embed Etherpad in an iFrame",
3
3
  "name": "ep_helmet",
4
- "version": "11.0.16",
4
+ "version": "11.0.18",
5
5
  "author": {
6
6
  "name": "John McLear",
7
7
  "email": "john@mclear.co.uk"
@@ -0,0 +1,13 @@
1
+ import {expect, test} from '@playwright/test';
2
+ import {getPadBody, goToNewPad} from 'ep_etherpad-lite/tests/frontend-new/helper/padHelper';
3
+
4
+ test.beforeEach(async ({page}) => {
5
+ await goToNewPad(page);
6
+ });
7
+
8
+ test.describe('ep_helmet', () => {
9
+ test('pad loads with plugin installed', async ({page}) => {
10
+ const padBody = await getPadBody(page);
11
+ await expect(padBody).toBeVisible();
12
+ });
13
+ });