mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-13 19:10:39 +00:00
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)
|
|
}
|
|
}
|