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
Note that matches should be true, but it is false.
This is because the .ignoreQueryParameters option results in the port getting stripped from the URL. The code that does that is in Foundation+Extension.swift:
// Returns the base URL string build with the scheme, host and path.
/// For example:
/// "https://www.apple.com/v1/test?param=test"
/// would be "https://www.apple.com/v1/test"
publicvarbaseString:String?{guardlet scheme = scheme,let host = host else{returnnil}return scheme +"://"+ host + path
}
This strips the query parameters as expected, but host doesn't include the port, so the resulting URL is also stripped of the port.
The above example returns true for matches if the ports are removed from the URLs.
Expected Behavior
URL matching should work as expected for URLs with manually specified ports, when the .ignoreQueryParameters option is enabled.
Actual Incorrect Behavior
URLs fail to match even if they are exactly the same if .ignoreQueryParameters is enabled and the URLs contain explicit ports.
The text was updated successfully, but these errors were encountered:
Platform Version
iOS 16.1
SDK Version
1.4.0
Xcode Version
Xcode 14.1
Steps To Reproduce
Run the following code:
Note that
matches
should betrue
, but it isfalse
.This is because the
.ignoreQueryParameters
option results in the port getting stripped from the URL. The code that does that is in Foundation+Extension.swift:This strips the query parameters as expected, but
host
doesn't include the port, so the resulting URL is also stripped of the port.The above example returns
true
formatches
if the ports are removed from the URLs.Expected Behavior
URL matching should work as expected for URLs with manually specified ports, when the
.ignoreQueryParameters
option is enabled.Actual Incorrect Behavior
URLs fail to match even if they are exactly the same if
.ignoreQueryParameters
is enabled and the URLs contain explicit ports.The text was updated successfully, but these errors were encountered: