Skip to content

Commit

Permalink
Complete sequence when there are no headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Jul 17, 2023
1 parent b02d216 commit 1799eb1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ public struct AsyncMessageFramingSequence<Base> : 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
Expand Down

0 comments on commit 1799eb1

Please sign in to comment.