Skip to content

Commit 005cf12

Browse files
filipecabacoabc3
andauthored
fix: Close fetch response on HTTP broadcast sent (#412)
Close fetch response on HTTP broadcast sent Co-authored-by: Stas <[email protected]>
1 parent 264b37d commit 005cf12

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/RealtimeChannel.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,8 @@ export default class RealtimeChannel {
463463
opts.timeout ?? this.timeout
464464
)
465465

466-
if (response.ok) {
467-
return 'ok'
468-
} else {
469-
return 'error'
470-
}
466+
await response.body?.cancel()
467+
return response.ok ? 'ok' : 'error'
471468
} catch (error: any) {
472469
if (error.name === 'AbortError') {
473470
return 'timed out'

0 commit comments

Comments
 (0)