Skip to content

Conversation

swhitty
Copy link
Owner

@swhitty swhitty commented Mar 4, 2025

Aligning within HTTPStatusCode, WSCloseCode now includes the reason within the structure making it easier to pass around:

public struct WSCloseCode: Sendable, Hashable {
    public var code: UInt16
    public var reason: String

    public init(_ code: UInt16) {
        self.code = code
        self.reason = ""
    }
    public init(_ code: UInt16, reason: String) {
        self.code = code
        self.reason = reason
    }
}

Additionally closes the stream when a close message is sent to client

Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.

Project coverage is 94.58%. Comparing base (7d98b0c) to head (9cd8705).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
FlyingFox/Sources/WebSocket/WSHandler.swift 82.35% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   94.52%   94.58%   +0.06%     
==========================================
  Files          62       62              
  Lines        4015     4023       +8     
==========================================
+ Hits         3795     3805      +10     
+ Misses        220      218       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@swhitty swhitty merged commit c11f6b7 into main Mar 4, 2025
17 of 18 checks passed
@swhitty swhitty deleted the WSCloseCode branch March 4, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant