Skip to content

Commit

Permalink
feat: add wss: scheme constant (#105)
Browse files Browse the repository at this point in the history
refactor: sort Scheme constants alfabetically, similar to other classes
test: add wss: scheme to Headers test

Co-authored-by: Bernard Scharp <bernard.scharp@futureof.finance>
  • Loading branch information
bitwise-operators and BJScharp authored Sep 13, 2022
1 parent d011033 commit eaf1605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Scheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:';
}
3 changes: 2 additions & 1 deletion tests/AddCspHeadersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ public function configure()
Scheme::DATA,
Scheme::HTTPS,
Scheme::WS,
Scheme::WSS,
]);
}
};
Expand All @@ -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')
);
});
Expand Down

0 comments on commit eaf1605

Please sign in to comment.