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
Copy file name to clipboardExpand all lines: Foundation/NSURL.swift
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -516,11 +516,8 @@ public class NSURLComponents : NSObject, NSCopying {
516
516
517
517
// Returns a URL created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
518
518
public varURL:NSURL?{
519
-
iflet result =_CFURLComponentsCopyURL(_components){
520
-
returnunsafeBitCast(result,NSURL.self)
521
-
}else{
522
-
returnnil
523
-
}
519
+
guardlet result =_CFURLComponentsCopyURL(_components)else{returnnil}
520
+
returnunsafeBitCast(result,NSURL.self)
524
521
}
525
522
526
523
// Returns a URL created from the NSURLComponents relative to a base URL. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
@@ -530,7 +527,7 @@ public class NSURLComponents : NSObject, NSCopying {
530
527
531
528
// Returns a URL string created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned.
// Warning: IETF STD 66 (rfc3986) says the use of the format "user:password" in the userinfo subcomponent of a URI is deprecated because passing authentication information in clear text has proven to be a security risk. However, there are cases where this practice is still needed, and so the user and password components and methods are provided.
0 commit comments