Skip to content

Commit 2f7710e

Browse files
committed
remove optional
1 parent 96d7101 commit 2f7710e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

FlyingFox/Sources/HTTPResponse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ public struct HTTPResponse: Sendable {
4747
}
4848
}
4949

50-
public var bodyData: Data? {
50+
public var bodyData: Data {
5151
get async throws {
5252
switch payload {
5353
case .httpBody(let body):
5454
return try await body.get()
5555
case .webSocket:
56-
return nil
56+
return Data()
5757
}
5858
}
5959
}

FlyingFox/Tests/HTTPRequestTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ final class HTTPResponseTests: XCTestCase {
6565
let response = HTTPResponse.make(webSocket: MessageFrameWSHandler.make())
6666

6767
// then
68-
await AsyncAssertNil(
69-
try await response.bodyData
68+
await AsyncAssertEqual(
69+
try await response.bodyData,
70+
Data()
7071
)
7172
}
7273

0 commit comments

Comments
 (0)