diff --git a/Sources/Foundation/NSError.swift b/Sources/Foundation/NSError.swift index 9543fb0c56..5d9d78672f 100644 --- a/Sources/Foundation/NSError.swift +++ b/Sources/Foundation/NSError.swift @@ -803,6 +803,7 @@ extension URLError { } /// The string for the URL which caused a load to fail. + @available(swift, deprecated: 6.1, message: "Use failingURL instead") public var failureURLString: String? { return _nsUserInfo[NSURLErrorFailingURLStringErrorKey] as? String } diff --git a/Sources/Foundation/NSURLError.swift b/Sources/Foundation/NSURLError.swift index a2fbb62b60..a3133962e1 100644 --- a/Sources/Foundation/NSURLError.swift +++ b/Sources/Foundation/NSURLError.swift @@ -20,6 +20,7 @@ public let NSURLErrorFailingURLErrorKey: String = "NSErrorFailingURLKey" /// The `NSError` userInfo dictionary key used to store and retrieve the NSString /// object for the URL which caused a load to fail. +@available(swift, deprecated: 6.1, message: "Use NSURLErrorFailingURLErrorKey instead") public let NSURLErrorFailingURLStringErrorKey: String = "NSErrorFailingURLStringKey" /// The `NSError` userInfo dictionary key used to store and retrieve the diff --git a/Sources/FoundationNetworking/NSURLRequest.swift b/Sources/FoundationNetworking/NSURLRequest.swift index cdda7bcadd..a0d179863c 100644 --- a/Sources/FoundationNetworking/NSURLRequest.swift +++ b/Sources/FoundationNetworking/NSURLRequest.swift @@ -373,6 +373,7 @@ open class NSURLRequest : NSObject, NSSecureCoding, NSCopying, NSMutableCopying open internal(set) var httpShouldHandleCookies: Bool = true + @available(swift, deprecated: 6.1, message: "HTTP/1 pipelining has known compatibility issues, please adopt HTTP/2 and HTTP/3 instead") open internal(set) var httpShouldUsePipelining: Bool = true open override var description: String { @@ -573,6 +574,7 @@ open class NSMutableURLRequest : NSURLRequest { set { super.httpShouldHandleCookies = newValue } } + @available(swift, deprecated: 6.1, message: "HTTP/1 pipelining has known compatibility issues, please adopt HTTP/2 and HTTP/3 instead") open override var httpShouldUsePipelining: Bool { get { return super.httpShouldUsePipelining } set { super.httpShouldUsePipelining = newValue } diff --git a/Sources/FoundationNetworking/URLProtectionSpace.swift b/Sources/FoundationNetworking/URLProtectionSpace.swift index 6470657bc5..26dcc234cf 100644 --- a/Sources/FoundationNetworking/URLProtectionSpace.swift +++ b/Sources/FoundationNetworking/URLProtectionSpace.swift @@ -29,6 +29,7 @@ public let NSURLProtectionSpaceHTTPS: String = "NSURLProtectionSpaceHTTPS" @const NSURLProtectionSpaceFTP @abstract The protocol for FTP */ +@available(swift, deprecated: 6.1, message: "FTP is deprecated") public let NSURLProtectionSpaceFTP: String = "NSURLProtectionSpaceFTP" /*! @@ -47,6 +48,7 @@ public let NSURLProtectionSpaceHTTPSProxy: String = "NSURLProtectionSpaceHTTPSPr @const NSURLProtectionSpaceFTPProxy @abstract The proxy type for ftp proxies */ +@available(swift, deprecated: 6.1, message: "FTP is deprecated") public let NSURLProtectionSpaceFTPProxy: String = "NSURLProtectionSpaceFTPProxy" /*! diff --git a/Sources/FoundationNetworking/URLRequest.swift b/Sources/FoundationNetworking/URLRequest.swift index f8ab4c8c7d..e87201e528 100644 --- a/Sources/FoundationNetworking/URLRequest.swift +++ b/Sources/FoundationNetworking/URLRequest.swift @@ -224,6 +224,7 @@ public struct URLRequest : ReferenceConvertible, Equatable, Hashable, Sendable { /// `true` if the receiver should transmit before the previous response /// is received. `false` if the receiver should wait for the previous response /// before transmitting. + @available(swift, deprecated: 6.1, message: "HTTP/1 pipelining has known compatibility issues, please adopt HTTP/2 and HTTP/3 instead") public var httpShouldUsePipelining: Bool { get { return _handle.map { $0.httpShouldUsePipelining } diff --git a/Sources/FoundationNetworking/URLSession/URLSessionConfiguration.swift b/Sources/FoundationNetworking/URLSession/URLSessionConfiguration.swift index 9236854f4c..89bb774dd7 100644 --- a/Sources/FoundationNetworking/URLSession/URLSessionConfiguration.swift +++ b/Sources/FoundationNetworking/URLSession/URLSessionConfiguration.swift @@ -204,6 +204,7 @@ open class URLSessionConfiguration : NSObject, NSCopying, @unchecked Sendable { */ /* Allow the use of HTTP pipelining */ + @available(swift, deprecated: 6.1, message: "HTTP/1 pipelining has known compatibility issues, please adopt HTTP/2 and HTTP/3 instead") open var httpShouldUsePipelining: Bool /* Allow the session to set cookies on requests */ @@ -229,9 +230,7 @@ open class URLSessionConfiguration : NSObject, NSCopying, @unchecked Sendable { /* The URL resource cache, or nil to indicate that no caching is to be performed */ open var urlCache: URLCache? - /* Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open - * and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) - */ + @available(swift, deprecated: 6.1, message: "Not supported") open var shouldUseExtendedBackgroundIdleMode: Bool /* An optional array of Class objects which subclass URLProtocol. @@ -253,6 +252,10 @@ open class URLSessionConfiguration : NSObject, NSCopying, @unchecked Sendable { @available(*, unavailable, message: "Not available on non-Darwin platforms") open var multipathServiceType: URLSessionConfiguration.MultipathServiceType { NSUnsupported() } + /* Uses the classic network loader */ + @available(*, unavailable, message: "Not available on non-Darwin platforms") + open var usesClassicLoadingMode: Bool { NSUnsupported() } + } @available(*, unavailable, message: "Not available on non-Darwin platforms") diff --git a/Sources/FoundationNetworking/URLSession/URLSessionTaskMetrics.swift b/Sources/FoundationNetworking/URLSession/URLSessionTaskMetrics.swift index 5de19fdeef..eaa0cdd030 100644 --- a/Sources/FoundationNetworking/URLSession/URLSessionTaskMetrics.swift +++ b/Sources/FoundationNetworking/URLSession/URLSessionTaskMetrics.swift @@ -29,6 +29,7 @@ open class URLSessionTaskMetrics : NSObject, @unchecked Sendable { public enum ResourceFetchType: Int, Sendable { case unknown = 0 case networkLoad = 1 + @available(swift, deprecated: 6.1, message: "Server push is not supported") case serverPush = 2 case localCache = 3 }