-
Notifications
You must be signed in to change notification settings - Fork 6
Update public IP server endpoints #30
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,32 +12,27 @@ public enum PublicIPAPIURLs { | |
|
|
||
| public enum Hybrid: String, CaseIterable { | ||
| case icanhazip = "https://icanhazip.com" | ||
| case ipv6test = "https://v4v6.ipv6-test.com/api/myip.php" | ||
| case seeip = "https://ip.seeip.org" | ||
| case whatismyipaddress = "https://bot.whatismyipaddress.com" | ||
| case ipify = "https://api.ipify.org" | ||
| case ifconfigMe = "https://ifconfig.me/ip" | ||
| case myip = "https://api.my-ip.io/v2/ip.txt" | ||
| case ident = "https://ident.me/" | ||
| } | ||
|
|
||
| public enum IPv4: String, CaseIterable { | ||
| case icanhazip = "https://ipv4.icanhazip.com" | ||
| case ipv6test = "https://v4.ipv6-test.com/api/myip.php" | ||
| case seeip = "https://ip4.seeip.org" | ||
| case whatismyipaddress = "https://ipv4bot.whatismyipaddress.com" | ||
| case ident = "https://v4.ident.me/" | ||
|
|
||
| case ipify = "https://api.ipify.org" | ||
|
|
||
| case ifconfigMe = "https://ipv4.ifconfig.me/ip" | ||
|
||
| case myip = "https://api4.my-ip.io/v2/ip.txt" | ||
| case ident = "https://v4.ident.me/" | ||
| case amazonaws = "https://checkip.amazonaws.com" | ||
| case ipecho = "https://ipecho.net/plain" | ||
| case ipinfo = "https://ipinfo.io/ip" | ||
| } | ||
|
|
||
| public enum IPv6: String, CaseIterable { | ||
| case icanhazip = "https://ipv6.icanhazip.com" | ||
| case ipv6test = "https://v6.ipv6-test.com/api/myip.php" | ||
| case seeip = "https://ip6.seeip.org" | ||
| case whatismyipaddress = "https://ipv6bot.whatismyipaddress.com" | ||
| case ident = "https://v6.ident.me/" | ||
|
|
||
| case ipify = "https://api6.ipify.org" | ||
| case ifconfigMe = "https://ipv6.ifconfig.me/ip" | ||
|
||
| case myip = "https://api6.my-ip.io/v2/ip.txt" | ||
| case ident = "https://v6.ident.me/" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,21 +31,21 @@ class SwiftPublicIPTests: XCTestCase { | |||||
| waitForExpectations(timeout: 40, handler: nil) | ||||||
| } | ||||||
|
|
||||||
| func test_hybrid_ipv6test() { | ||||||
| func test_hybrid_ipify() { | ||||||
| let exp = expectation(description: "\(#function)\(#line)") | ||||||
| testPublicIP(PublicIPAPIURLs.Hybrid.ipv6test.rawValue, exp) | ||||||
| testPublicIP(PublicIPAPIURLs.Hybrid.ipify.rawValue, exp) | ||||||
| waitForExpectations(timeout: 40, handler: nil) | ||||||
| } | ||||||
|
|
||||||
| func test_hybrid_seeip() { | ||||||
| func test_hybrid_ifconfigMe() { | ||||||
| let exp = expectation(description: "\(#function)\(#line)") | ||||||
| testPublicIP(PublicIPAPIURLs.Hybrid.seeip.rawValue, exp) | ||||||
| testPublicIP(PublicIPAPIURLs.Hybrid.ifconfigMe.rawValue, exp) | ||||||
| waitForExpectations(timeout: 40, handler: nil) | ||||||
|
Comment on lines
+40
to
43
|
||||||
| } | ||||||
|
|
||||||
| func test_hybrid_whatismyipaddress() { | ||||||
| func test_hybrid_myip() { | ||||||
| let exp = expectation(description: "\(#function)\(#line)") | ||||||
| testPublicIP(PublicIPAPIURLs.Hybrid.whatismyipaddress.rawValue, exp) | ||||||
| testPublicIP(PublicIPAPIURLs.Hybrid.myip.rawValue, exp) | ||||||
| waitForExpectations(timeout: 40, handler: nil) | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -63,21 +63,21 @@ class SwiftPublicIPTests: XCTestCase { | |||||
| waitForExpectations(timeout: 40, handler: nil) | ||||||
| } | ||||||
|
|
||||||
| func test_ipv4_ipv6test() { | ||||||
| func test_ipv4_ipify() { | ||||||
| let exp = expectation(description: "\(#function)\(#line)") | ||||||
| testPublicIP(PublicIPAPIURLs.IPv4.ipv6test.rawValue, exp) | ||||||
| testPublicIP(PublicIPAPIURLs.IPv4.ipify.rawValue, exp) | ||||||
| waitForExpectations(timeout: 40, handler: nil) | ||||||
| } | ||||||
|
|
||||||
| func test_ipv4_seeip() { | ||||||
| func test_ipv4_ifconfigMe() { | ||||||
|
||||||
| func test_ipv4_ifconfigMe() { | |
| func test_ipv4_ifconfigme() { |
Copilot
AI
Dec 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test function name "test_ipv6_ifconfigMe" should match the naming convention of other test functions. If the enum case is renamed to "ifconfigme" (all lowercase) for consistency, this test function name should be updated to "test_ipv6_ifconfigme" to match.
Copilot
AI
Dec 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test entry string "test_hybrid_ifconfigMe" should match the naming convention of other test entries. If the enum case and test function are renamed to use all lowercase "ifconfigme", this entry should be updated to ("test_hybrid_ifconfigme", test_hybrid_ifconfigme) to match.
| ("test_hybrid_ifconfigMe", test_hybrid_ifconfigMe), | |
| ("test_hybrid_ifconfigme", test_hybrid_ifconfigMe), |
Copilot
AI
Dec 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test entry string "test_ipv4_ifconfigMe" should match the naming convention of other test entries. If the enum case and test function are renamed to use all lowercase "ifconfigme", this entry should be updated to ("test_ipv4_ifconfigme", test_ipv4_ifconfigme) to match.
Copilot
AI
Dec 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test entry string "test_ipv6_ifconfigMe" should match the naming convention of other test entries. If the enum case and test function are renamed to use all lowercase "ifconfigme", this entry should be updated to ("test_ipv6_ifconfigme", test_ipv6_ifconfigme) to match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enum case name "ifconfigMe" uses an inconsistent naming convention. The other enum cases in this file use all lowercase names (icanhazip, ipify, ident, amazonaws, ipinfo), but this one uses camelCase with a capital 'M'. For consistency with the rest of the codebase, consider renaming this to "ifconfigme" (all lowercase).