From 1799eb10639805a12026b7775a360c9439e22969 Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Mon, 17 Jul 2023 15:27:21 -0400 Subject: [PATCH] Complete sequence when there are no headers --- .../Additions/AsyncMessageFramingSequence.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/LanguageServerProtocol/Additions/AsyncMessageFramingSequence.swift b/Sources/LanguageServerProtocol/Additions/AsyncMessageFramingSequence.swift index 566af73..1f0b116 100644 --- a/Sources/LanguageServerProtocol/Additions/AsyncMessageFramingSequence.swift +++ b/Sources/LanguageServerProtocol/Additions/AsyncMessageFramingSequence.swift @@ -59,6 +59,10 @@ public struct AsyncMessageFramingSequence : AsyncSequence where Base : Asy headers[name] = value } + if headers.isEmpty { + return nil + } + // then use them to read the content guard var length = Int(headers["Content-Length"] ?? "") else { throw MessageFramingError.contentLengthMissing