Skip to content
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

Merged
merged 1 commit into from Feb 6, 2023
Merged

Fix relative path in uri #10024

merged 1 commit into from Feb 6, 2023

Conversation

Kukks
Copy link
Contributor

@Kukks Kukks commented Feb 1, 2023

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.

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.
Copy link
Collaborator

@kiminuo kiminuo left a 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.

@kiminuo kiminuo requested a review from molnard February 5, 2023 21:11
@lontivero
Copy link
Collaborator

cACK. Just FTR, it is also possible to use ./ with the exact same result as the intended.

> 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

@lontivero
Copy link
Collaborator

We need to verify the server side changes work okay. It looks like a completely safe change to me.

@kiminuo
Copy link
Collaborator

kiminuo commented Feb 6, 2023

@adamPetho Can we check easily that the server side changes are OK? Deploy to testnet? I'm not sure.

@adamPetho
Copy link
Collaborator

Can we check easily that the server side changes are OK? Deploy to testnet?

I think that's the easiest way to test it. It works fine on RegTest.

@kiminuo
Copy link
Collaborator

kiminuo commented Feb 6, 2023

Can we check easily that the server side changes are OK? Deploy to testnet?

I think that's the easiest way to test it. It works fine on RegTest.

And can anybody do it then?

@molnard
Copy link
Collaborator

molnard commented Feb 6, 2023

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.

@molnard molnard merged commit f3d72f0 into zkSNACKs:master Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants