You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is happening here is that Foundation is standardising the relative portion of the path only, NOT the overall URL.
Typically, what "standardising" does is remove "." components, and other components which are popped by a subsequent "..". As the test shows, ".." components in the relative path portion may actually pop components from the base URL.
'.standardized' is just far too naive in its whole approach. I don't expect these to be trivial fixes; the function may need to be substantially rewritten.
The text was updated successfully, but these errors were encountered:
It's hard to find another library which implements the same standard as Foundation (most of them use newer standards), but I did find one: "URL Toolkit" in JS (https://github.com/tjenkinson/url-toolkit).
Testing it on jsfiddle, it agrees that "/foo/joe/blow" is wrong; the path should be "/joe/blow", like the non-standardised URL's path returns.
Environment
macOS 11.6, XCode 13.1 (13A1030d)
Additional Detail from JIRA
md5: 2cc1da750e65dafceb48da71b218fd63
Issue Description:
It's just entirely broken. This example adapted from Foundation's test suite (NSURLWithString-parse-relative-basic-005):
What is happening here is that Foundation is standardising the relative portion of the path only, NOT the overall URL.
Typically, what "standardising" does is remove "." components, and other components which are popped by a subsequent "..". As the test shows, ".." components in the relative path portion may actually pop components from the base URL.
This is slightly similar to, but different from, https://bugs.swift.org/browse/SR-14145
'.standardized' is just far too naive in its whole approach. I don't expect these to be trivial fixes; the function may need to be substantially rewritten.
The text was updated successfully, but these errors were encountered: