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

Some slight doc improvements in rack-protection #2072

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

davetron5000
Copy link

Problem(s)

  • Base rack protection middleware does not document its options, and I found them hard to know about due to this absent documentation

  • Formatting of Rack::Protection::AuthenticityTokens options rendered incorrectly (see screenshot)

    Screenshot 2024-11-29 at 2 56 19 PM
  • Rack::Protection::ContentSecurityPolicy's docs were not specific as to the behavior of the class

Solution

Updated the docs. I started to look at all the classes for a doc update, but decided to stop here as these addressed my issue and I wasn't sure if this sorts of changes would be accepted. If they are, I would happy to refresh the docs in the other classes.

#
# These may be given to any subclass, however they may affect different subclasses differently.
#
# [<tt>:reaction</tt>] - name of a method of the class that will be used to respond when the middleware rejects the response. Default behavior is to use #default_reaction.
Copy link
Author

Choose a reason for hiding this comment

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

These options are all really useful and I didn't know about them until I started reading the source.

@dentarg dentarg added the docs label Dec 17, 2024
@dentarg
Copy link
Member

dentarg commented Jan 8, 2025

Was it necessary to remove the line breaks? There's some very long lines now

@davetron5000
Copy link
Author

@dentarg Sorry, I think I mis-interpreted why the formatting was broken and assumed it was the existence of any linebreak. In reality, it's just when subsequent lines don't line up with the original bullet point. I've reformatted to make things more readable (I think). See e2dfc1d

If that's not exactly right, let me know your ideal # of columns and I can re-reformat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants