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

Upgrade Feature-Policy to Permissions-Policy #2228

Merged
merged 1 commit into from
Jan 23, 2022
Merged

Upgrade Feature-Policy to Permissions-Policy #2228

merged 1 commit into from
Jan 23, 2022

Conversation

iamdoubz
Copy link
Contributor

Convert old, soon to be defunct, Feature-Policy with its replacement Permissions-Policy

src/util.rs Outdated
@@ -27,7 +27,7 @@ impl Fairing for AppHeaders {
}

fn on_response(&self, _req: &Request, res: &mut Response) {
res.set_raw_header("Feature-Policy", "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'none'; camera 'none'; encrypted-media 'none'; fullscreen 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture 'none'; sync-xhr 'self' https://haveibeenpwned.com https://2fa.directory; usb 'none'; vr 'none'");
res.set_raw_header("Permissions-Policy", "accelerometer=(); ambient-light-sensor=(); autoplay=(); camera=(); encrypted-media=(); fullscreen=(); geolocation=(); gyroscope=(); magnetometer=(); microphone=(); midi=(); payment=(); picture-in-picture=(); sync-xhr=(self \"https://haveibeenpwned.com\" \"https://2fa.directory\"); usb=(); vr=()");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Permissions-Policy uses commas as separators, not semicolons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I get for copy + paste. I have changed the semicolons to commas.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you squash the commits? Or do a force push?

The following should work (but this isn't tested)

git reset --soft HEAD~1
git commit --amend --no-edit
git push origin +iamdoubz-feature-to-permissions-policy-patch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was really fun... there is only one commit now. (PS The three commands did work)

Convert old, soon to be defunct, Feature-Policy with its replacement Permissions-Policy
@dani-garcia dani-garcia merged commit 4a88e7e into dani-garcia:main Jan 23, 2022
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.

5 participants