-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add a style guide to suggest to pass a string literal as a URL to http method calls #359
base: master
Are you sure you want to change the base?
Conversation
…p method calls Original discussion: rubocop#328 Signed-off-by: moznion <[email protected]>
I’m in general in favour of this change, but I admit that I’m biased because I’m mostly working on APIs, and the general picture may not be as simple as the limited use case I got used to. Rails guides say (about the use of path helpers in views):
A lot of to digest in this brief note:
What is the source of the brittleness? Should we introduce a concept of route stability, and say that this only makes sense as a measure to ensure route stability? And otherwise path helpers are preferrable to reduce brittleness? What do you think? |
I appreciate your explanation.
Yeah, I’m on the same page, and the main motivation comes from this. Anyway, my understanding of the term “brittleness” is related to path-traversal attacks, where malicious “URL-ish” arguments are injected. I completely agree with the approach of using helpers with URL escaping on the given argument to protect against this type of vulnerability. |
Based on #328 shouldn't this section mention that it applies to tests and not production code? |
@dvandersluis Thank you for your suggestion; it sounds great to me. However, what would be the best approach: should I include that in the description, or move it under the “Testing” section? |
Putting it under Testing would make sense to me! |
Signed-off-by: moznion <[email protected]>
@dvandersluis Thank you, I moved it: 1c4cf0e |
@moznion you might also want to mention tests in the PR title, I was confused the first time reading this. |
Original discussion: #328