We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 96d7101 commit 2f7710eCopy full SHA for 2f7710e
FlyingFox/Sources/HTTPResponse.swift
@@ -47,13 +47,13 @@ public struct HTTPResponse: Sendable {
47
}
48
49
50
- public var bodyData: Data? {
+ public var bodyData: Data {
51
get async throws {
52
switch payload {
53
case .httpBody(let body):
54
return try await body.get()
55
case .webSocket:
56
- return nil
+ return Data()
57
58
59
FlyingFox/Tests/HTTPRequestTests.swift
@@ -65,8 +65,9 @@ final class HTTPResponseTests: XCTestCase {
65
let response = HTTPResponse.make(webSocket: MessageFrameWSHandler.make())
66
67
// then
68
- await AsyncAssertNil(
69
- try await response.bodyData
+ await AsyncAssertEqual(
+ try await response.bodyData,
70
+ Data()
71
)
72
73
0 commit comments