-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: main
Are you sure you want to change the base?
Some slight doc improvements in rack-protection #2072
Conversation
ALthough it reads better in the source code file, the rendering creates code blocks the additional lines.
# | ||
# 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. |
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.
These options are all really useful and I didn't know about them until I started reading the source.
Was it necessary to remove the line breaks? There's some very long lines now |
@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. |
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::AuthenticityToken
s options rendered incorrectly (see screenshot)Rack::Protection::ContentSecurityPolicy
's docs were not specific as to the behavior of the classSolution
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.