You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
457 B
Swift
14 lines
457 B
Swift
import Foundation
|
|
|
|
public enum LocalNetworkURLSupport {
|
|
public static func isLocalNetworkHTTPURL(_ url: URL) -> Bool {
|
|
guard let scheme = url.scheme?.lowercased(), scheme == "http" || scheme == "https" else {
|
|
return false
|
|
}
|
|
guard let host = url.host?.trimmingCharacters(in: .whitespacesAndNewlines), !host.isEmpty else {
|
|
return false
|
|
}
|
|
return LoopbackHost.isLocalNetworkHost(host)
|
|
}
|
|
}
|