Unleash / unleash-client-rust

Unleash client SDK for Rust language projects
Apache License 2.0
23 stars 17 forks source link

Fix double slash in url. #80

Closed mstyura closed 7 months ago

mstyura commented 8 months ago

About the changes

It was unclear whether it was expected by user that provided API url is end with / or not. I've actually passed URL with trailing /, which ended up inability to register client. It wen't unnoticed until deployed on prod, because there was different URL.

image

I've made a change to make SDK tolerate URLs ended with / by trimming user-provided URL before concatenation with rest of endpoint.

Important files

Discussion points

mstyura commented 8 months ago

@daveleek could you please take a look?

mstyura commented 8 months ago

Java SDK handles double slashes here: https://github.com/Unleash/unleash-client-java/blob/b2ac9aee6aecbd3e968ed5c0e51bb5fca1c60452/src/main/java/io/getunleash/util/UnleashURLs.java#L16-L18

thomasheartman commented 8 months ago

Noticed Clippy is failing for a file you haven't touched. That should be perfectly safe to ignore, but I wanna see if I can make CI green before merging anything. I've linked the (merged) pull request that fixes it. Would you mind just rebasing / merging those changes so we can get the full pipeline to green?