-
Notifications
You must be signed in to change notification settings - Fork 129
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 URL.resolve and PathInfo.normalize #2090
Conversation
Additionally, as per RFC3986 Secion-3.1 , URL schemes should be case-insensitive, producing only lowercase scheme names for consistency. Should I apply this change in this pull request as well? |
@soywiz I have one more scenario to handle: if the base URL is empty or not absolute, how should it be resolved? I think we should return the access URL if it's absolute; otherwise, return an empty string or null. |
Thanks @itboy87! I have merged it now as it cover and fixes already some scenarios.
Makes sense. Feel free to make a separate PR for that.
I would have In this case too, let's make those changes in a separate PR. |
I have created two issues for covering your suggestions:
Feel free to make PRs to handle those. And thanks! |
ok Great. |
Changes in
URL.resolve
URLTest.testResolve
.assertEquals("https://example2.com/one", URL.resolve("https://example.com/", "//example2.com/one"))
assertEquals("https://example.com/one", URL.resolve("https://example.com/one", ""))
String.normalizeUrl
.Changes in
PathInfo.normalize
URLTest.testNormalize
.removeEndSlash
.true
.assertEquals("g", "g/".pathInfo.normalize())
assertEquals("g/", "g/".pathInfo.normalize(removeEndSlash = false))