From eaf1605682b81099eb36061933072c6dccaf0988 Mon Sep 17 00:00:00 2001 From: bitwise-operators <67020940+bitwise-operators@users.noreply.github.com> Date: Tue, 13 Sep 2022 17:45:35 +0200 Subject: [PATCH] feat: add wss: scheme constant (#105) refactor: sort Scheme constants alfabetically, similar to other classes test: add wss: scheme to Headers test Co-authored-by: Bernard Scharp --- src/Scheme.php | 3 ++- tests/AddCspHeadersTest.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Scheme.php b/src/Scheme.php index c9828b0..c143151 100644 --- a/src/Scheme.php +++ b/src/Scheme.php @@ -4,9 +4,10 @@ abstract class Scheme { + const BLOB = 'blob:'; const DATA = 'data:'; const HTTP = 'http:'; const HTTPS = 'https:'; - const BLOB = 'blob:'; const WS = 'ws:'; + const WSS = 'wss:'; } diff --git a/tests/AddCspHeadersTest.php b/tests/AddCspHeadersTest.php index 01d2c64..f457682 100644 --- a/tests/AddCspHeadersTest.php +++ b/tests/AddCspHeadersTest.php @@ -305,6 +305,7 @@ public function configure() Scheme::DATA, Scheme::HTTPS, Scheme::WS, + Scheme::WSS, ]); } }; @@ -314,7 +315,7 @@ public function configure() $headers = getResponseHeaders(); assertEquals( - 'img-src data: https: ws:', + 'img-src data: https: ws: wss:', $headers->get('Content-Security-Policy') ); });