Skip to content

Commit 8c98a59

Browse files
committed
PR changes
1 parent 8e0e289 commit 8c98a59

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/GRPCOTelTracingInterceptors/Tracing/SpanAttributes+GRPCTracingKeys.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ extension Int {
215215
value &+= Int(utf8Char)
216216
}
217217

218-
guard value <= 65535 else {
219-
// Valid IP port values go up to 2^16-1 = 65535.
218+
guard value <= Int(UInt16.max) else {
219+
// Valid IP port values go up to 2^16-1.
220220
// If a number greater than this was given, it can't be a valid port.
221221
return nil
222222
}

Tests/GRPCOTelTracingInterceptorsTests/PeerAddressTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ struct PeerAddressTests {
6868
("65536", nil), // Invalid: over 65535 IP port limit
6969
("654321", nil), // Invalid: over 5 digits
7070
("abc", nil), // Invalid: no digits
71-
("a123", nil), // Invalid: mixed digits and characters outside the valid ascii range for digits
72-
("123a", nil), // Invalid: mixed digits and characters outside the valid ascii range for digits
73-
("(123", nil), // Invalid: mixed digits and characters outside the valid ascii range for digits
74-
("123(", nil), // Invalid: mixed digits and characters outside the valid ascii range for digits
71+
("a123", nil), // Invalid: mixed digits and chars outside the valid ascii range for digits
72+
("123a", nil), // Invalid: mixed digits and chars outside the valid ascii range for digits
73+
("(123", nil), // Invalid: mixed digits and chars outside the valid ascii range for digits
74+
("123(", nil), // Invalid: mixed digits and chars outside the valid ascii range for digits
7575
("", nil), // Invalid: empty string
7676
]
7777
)

0 commit comments

Comments
 (0)