-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
#13938 Remove slash when appended to map key in REST call #16688
#13938 Remove slash when appended to map key in REST call #16688
Conversation
Can one of the admins verify this patch? |
@ryanlindeborg Thanks for the PR! 🎉 As discussed here: #13938 (comment) , we'll wait with the reviews until you check the other places. Thanks a lot, looking forward to it! |
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.
Happy to see a new committer here.
To be honest, I'm not sure if we need the change. IIUC, after this change we allow slash within the key, but not at the end (or it has to be doubled). Still, as I don't have a strong opinion what's the correct approach here, I'm ready to approve and merge once the comments are covered.
I think we'll need to comment on the URL processing in the Reference manual.
* @param str | ||
* @return the string with trailing slash removed | ||
*/ | ||
public static String stripTrailingSlash(String str) { |
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.
It would be great to cover the util method with tests.
* @return the string with trailing slash removed | ||
*/ | ||
public static String stripTrailingSlash(String str) { | ||
if (str.charAt(str.length() - 1) == '/') { |
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.
Empty Strings and null
values can fail here.
Thanks for the feedback @kwart ! Should I be updating the hazelcast-reference-manual repository to detail the changes from this ticket? |
If you are able to cover the behavior in the reference manual too, it would be great. Thanks. |
@ryanlindeborg Looks great! Regarding the reference manual, here's the repository: https://github.com/hazelcast/hazelcast-reference-manual . Could you please send a PR to the relevant sections to make sure the documentaiton is inline with your changes? One last thing - before we merge the PR, could I ask you to sign our Contributor's agreement? |
@Holmistr Submitted my PR to the reference manual repository! And I believe I sent in my Contributor's agreement a few days ago |
@ryanlindeborg You're absolutely right, I'm just blind! In that case there's nothing more to do here, let merge the PR. Welcome to Hazelcast community family 🍻 and thank you very much for your contribution! 🎉 |
This PR removes the ending slash in the uri when it is appended to a key in a REST API call to put a key-value pair to a map.
Fixes: #13938