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
Improve Content Security Policy documentation [ci-skip] #44470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 👍
guides/source/security.md
Outdated
``` | ||
|
||
```ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When code snippets are from different contexts (e.g. config/initializers/content_security_policy.rb
and app/controllers/posts_controller.rb
), I prefer to keep the code blocks separate to provide visual distinction in the rendered output. Also, it gives each snippet a dedicated "Copy" button.
(I did some work toward that in #40922.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point. I agree.
- Use "HTTP Content-Security-Policy response header" instead of "Content Security Policy", to make it clear the header will be set. - Instead of having a long list of examples in the guide, add a description to each example. Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
Improve Content Security Policy documentation [ci-skip] (cherry picked from commit 258e9ad)
Thanks @jonathanhefner ! |
Summary
Security Policy", to make it clear the header will be set.
report_uri
in the guides.description to each example.
Before
After