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 relative path in uri #10024
Fix relative path in uri #10024
Conversation
When the base url has a subpath, and the relative url has a leading "/", the subpath of the base url is ignored. Initially ran into this in zkSNACKs#9904, and @kiminuo showed me the correct usage. Since I was only testing with the wabisabi client, it all worked fine. Now, I was testing with the full wasabi client ans the api calls in `WasabiClient` all have a leading "/", causing the same issue. This PR removes all leading "/" in HttpClient Send requests.
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.
The changes look correct to me. I can run WW with these changes too, so it looks OK.
cACK. Just FTR, it is also possible to use > let baseUri = Uri "http://mydomain/api/"
- let relativeUri = Uri("./path/subpath?q=query", UriKind.Relative)
- let uri = Uri(baseUri, relativeUri);;
val baseUri: Uri = http://mydomain/api/
val relativeUri: Uri = ./path/subpath?q=query
val uri: Uri = http://mydomain/api/path/subpath?q=query
> let relativeUri = Uri("path/subpath?q=query", UriKind.Relative)
- let uri = Uri(baseUri, relativeUri);;
val relativeUri: Uri = path/subpath?q=query
val uri: Uri = http://mydomain/api/path/subpath?q=query
|
We need to verify the server side changes work okay. It looks like a completely safe change to me. |
@adamPetho Can we check easily that the server side changes are OK? Deploy to testnet? I'm not sure. |
I think that's the easiest way to test it. It works fine on RegTest. |
And can anybody do it then? |
After the merge, yes. As a fundamental test, RegTest is enough - for being able to merge - so I will do it. |
When the base url has a subpath, and the relative url has a leading "/", the subpath of the base url is ignored. Initially ran into this in #9904, and @kiminuo showed me the correct usage. Since I was only testing with the wabisabi client, it all worked fine. Now, I was testing with the full wasabi client ans the api calls in
WasabiClient
all have a leading "/", causing the same issue. This PR removes all leading "/" in HttpClient Send requests.