We are having issues using a Node API provider that requires a path prefix like (https://provider.com/rpc/xlm/{auth-key}/).
Currently the SDK only uses the domain part of the supplied Horizon URI, and the path is fully replaced by the segments generated by the various RequestBuilders.
Through this change the original path is now stored and used later on when adding the segments again.
I'm not entirely sure in what category this falls (bug/ feature/ breaking).
If users have set-up the serverUri with a path that shouldn't be there, it would be included now.
I'm happy to update the version once it's clear if it's major/minor/fix.
Workaround
As a temporary workaround we're using the following:
let prefixUriBuilderOfSnd (first: string) (second: Uri) =
let urlBuilder = new UriBuilder(first)
let target = new UriBuilder(second)
// do not update if the path is the default `/`
if urlBuilder.Path = "/" then
target.Uri
elif target.Path.StartsWith("/") then
target.Path <- urlBuilder.Path + target.Path[1..]
target.Uri
else
target.Path <- urlBuilder.Path + target.Path
target.Uri
let private overrideServerUriHandler =
{ new DelegatingHandler(InnerHandler = new HttpClientHandler()) with
member x.Send(request, cancellationToken) =
request.RequestUri <- prefixUriBuilderOfSnd serverUri request.RequestUri
base.Send(request, cancellationToken)
member x.SendAsync(request, cancellationToken) =
request.RequestUri <- prefixUriBuilderOfSnd serverUri request.RequestUri
base.SendAsync(request, cancellationToken)
}
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[x] I have read the CONTRIBUTING document.
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
We are having issues using a Node API provider that requires a path prefix like (
https://provider.com/rpc/xlm/{auth-key}/
). Currently the SDK only uses the domain part of the supplied Horizon URI, and the path is fully replaced by the segments generated by the various RequestBuilders.Through this change the original path is now stored and used later on when adding the segments again.
I'm not entirely sure in what category this falls (bug/ feature/ breaking). If users have set-up the serverUri with a path that shouldn't be there, it would be included now. I'm happy to update the version once it's clear if it's major/minor/fix.
Workaround
As a temporary workaround we're using the following:
Types of changes