Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing semicolon #66

Merged

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Feb 21, 2023

Currently a CSP like this:

$csp = (new CSPBuilder())
    ->setSelfAllowed('default-src', true)
    ->addSource('img-src', 'ytimg.com')
    ->disableOldBrowserSupport()
;

will produce a header like this:

default-src 'self'; img-src ytimg.com; 

i.e. if you do not have directives like upgrade-insecure-requests then there will always be a trailing semicolon (and space). While this does not lead to any issues if you use this header as is, it is still inconsistent and unexpected imho. This PR would always remove the trailing semicolon and space.

@paragonie-security paragonie-security merged commit 172dc0a into paragonie:master Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants