Skip to content

Commit

Permalink
When using UriBuilder, pass uri.OriginalString
Browse files Browse the repository at this point in the history
The BCL’s handling of relative URIs is pretty broken.

#163
  • Loading branch information
tintoy authored Oct 14, 2024
1 parent 9086efa commit bb32297
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/KubeClient/Utilities/UriHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static string SafeGetPathAndQuery(this Uri uri)
return uri.PathAndQuery;

// Slightly ugly, but System.Uri doesn't attempt to parse relative URIs so we have to resort to System.UriBuilder.
UriBuilder uriComponents = new UriBuilder(uri);
UriBuilder uriComponents = new UriBuilder(uri.OriginalString);

return $"{uriComponents.Path}{uriComponents.Query}";
}
Expand Down

0 comments on commit bb32297

Please sign in to comment.