-
Notifications
You must be signed in to change notification settings - Fork 421
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
fix: trim trailing slash in url storage options (#2656) #2775
Conversation
Tried closing PR #2770 and re-opening the same here in this PR, but the workflows are still stuck at |
Workflows require approval each time |
Ohhh got it, thanks! 👍🏽 |
.map(|(k, v)| { | ||
let needs_trim = v.starts_with("http://") | ||
|| v.starts_with("https://") | ||
|| k.to_lowercase().ends_with("_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.
what are we checking here? i.e. what does a _url
suffix signify?
I'm probably just missing something obvious 😆.
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.
ah - from the tests i gather this is a convention we are introducing?
Should we document this behavior in a docstring somewhere?
This trims trailing slash if present in a storage option's value if it's key ends with `_URL` (e.g. `HOST_URL`) or if the value itself seems to be a url (i.e. starts with `http://` or `https://`). This also adds supporting test for this fix.
fb50878
to
b30d5c3
Compare
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.
Thanks for taking care of this!
Description
This trims trailing slash if present in a storage option's value
if it's key ends with
_URL
(e.g.HOST_URL
) or if the valueitself seems to be a url (i.e. starts with
http://
orhttps://
).This also adds supporting test for this fix.
Related Issue(s)
Documentation
N/A