-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[RabbitMQ] add a protocol if there isn't one #909
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.
One question about this strategy
# urlparse.urljoin cannot add a protocol to the rest of the url for some reason. | ||
# This still leaves the potential for errors, but such urls would never have been valid, either | ||
# and it's not likely to be useful to attempt to catch all possible mistakes people could make | ||
base_url = 'http://' + base_url |
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.
How does this play with kubernetes/autoconfig? See #838
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.
Actually http://rabbitmq-management.default:443
would work, so we're good.
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.
LGTM!
What does this PR do?
Right now if a protocol isn't specified, a bunch of rabbit requests will fail. This is not great. They shouldn't fail. To be specific, if a url has no protocol,
urlparse.urljoin
will behave in an anomalous manner. This PR will address part of the issue that we saw in #838.For example:
So, we have to assign it a protocol. We'll assume http.
Motivation
This is an old bug that has tripped up a bunch of people.
Versioning
manifest.json
CHANGELOG.md
. Please useUnreleased
as the date in the titlefor the new section.
Additional Notes
There are other ways people can mess up urls. If someone puts in a url like: '//gmmeyer.com' or '://gmmeyer.com' or something, it should fail. We cannot attempt to fix every permutation of how people can get their urls wrong. This just assumes that if a url is bare, it's meant to have an http protocol--which is what requests does anyway