Skip to content
Myr

feat(secure-headers): add missing W3C Permissions-Policy directives (#5214)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* feat(secure-headers): add missing W3C Permissions-Policy directives * feat(secure-headers): add missing W3C Permissions-Policy directives and spec references * remove unnecessary directives and comments ---------

authored by Nanasi · committed by GitHub · parent 329b6f4 · Browse files · 2 files+19 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Yusuke Wada <yusuke@kamawada.com>

Diff stats

2 files+19 added−1 removed

  • tests:+4 added−1 removed
  • other:+15 added−0 removed

2 files+19 added−1 removed

modified:src/middleware/secure-headers/index.test.ts+4 added-1 removed
179 unmodified lines
180 usb: ['self', 'https://a.example.com', 'https://b.example.com'],181 accelerometer: ['https://*.example.com'],182 gyroscope: ['src'],183 magnetometer: ['https://a.example.com', 'https://b.example.com'],184 mediasession: ['self'],185 deferredFetch: ['none'],186 },187 })188 )189
1 unmodified line
191 expect(res.headers.get('Permissions-Policy')).toEqual(192 'fullscreen=(self), bluetooth=(), payment=(self "example.com"), sync-xhr=(), camera=(), microphone=*, ' +193 'geolocation=*, usb=(self "https://a.example.com" "https://b.example.com"), ' +194 'accelerometer=("https://*.example.com"), gyroscope=(src), ' +193 'magnetometer=("https://a.example.com" "https://b.example.com")'195 'magnetometer=("https://a.example.com" "https://b.example.com"), ' +196 'mediasession=(self), deferred-fetch=()'197 )198 })199200 it('Remove X-Powered-By', async () => {
471 unmodified lines
modified:src/middleware/secure-headers/permissions-policy.ts+15 added