launchdarkly / swift-eventsource

Server-sent events (SSE) client implementation in Swift for iOS, macOS, tvOS, and watchOS
https://launchdarkly.github.io/swift-eventsource/
Other
187 stars 34 forks source link

Should not reconnect, when 204 received #50

Closed mkubista closed 1 year ago

mkubista commented 2 years ago

Describe the bug According to SSE specification (here) client should not try to reconnect, when response with 204 http code is received. In this implementation all 2xx codes are treated as success. So when 204 is received and then connection is closed, the library tries to reconnect.

To reproduce Send initial response with 204 code.

Expected behavior Library should not try to reconnect. It should shutdown instead. Also application should be notified, that this happen.

XCode and Swift version For instance, XCode 11.5, Swift 5.1.

Platform the issue occurs on iPhone

keelerm84 commented 2 years ago

Thank you for bringing this to our attention. I have filed this internall as sc-166962. I will update you when we have a resolution.

keelerm84 commented 1 year ago

Fixed in 3.1.1