-
Notifications
You must be signed in to change notification settings - Fork 897
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
Resolve string handling for "https://" or "http://" in update_rhsm_conf #17222
Merged
carbonin
merged 6 commits into
ManageIQ:master
from
robbmanes:properly_validate_proxy_urls
Apr 3, 2018
+24
−16
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab7f652
Resolve string handling for "https://" or "http://" in update_rhsm_conf
robbmanes 58c65e4
Add tests for RegistrationSystem.update_rhsm_conf with http and https
bdunne 65bfb6a
Reduce duplicate test logic
bdunne 47ddbb4
Test against multiple addresses (hostname, IPv4, IPv6)
bdunne dafb5f7
myport is not a valid port, 0 is reserved so use that instead
bdunne 963a3f3
Fix issues related to proxy_address
bdunne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I feel like this just punts the issue down the road. Is there no field validation for this? Couldn't we just say "This thing needs to be a valid URI" and give a flash message otherwise?
For example if someone were to forget a
/
and enter "http:/example.com:123" you would end up in this situation right?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.
I agree - I tried using
Addressable::URI
objects initially before I did string checking but am not sure there is error checking by the caller of this method, and testing with that manner threw other ugly exceptions further down the stack that similar didn't appear in the UI or any easy-to-interpret log, so I instead just altered the string validation.I can look at it deeper after this week, I am onsite with a customer now unfortunately, or we can close this PR in favor of a method that does better error handling.
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.
¯\(ツ)/¯ I think I'm okay with this as is for now. @carbonin and I were just discussing that we may want to open a RFE to the UI to add validation to this field. At least this adds the ability to accept URLs