Analyze the Result and determine how best to send it.
Analyze the Result and determine how best to send it. This may involve looking at headers, buffering the enumerator, etc. The returned value will indicate how to stream the result and will provide an Enumerator or Array with the result body that should be streamed. CannotStream will be returned if the Result cannot be streamed to the given client. This can happen if a result requires Transfer-Encoding but the client uses HTTP 1.0. It can also happen if there is an error in the Result headers.
Start reading an Enumerator and see if it is only zero or one elements long.
Start reading an Enumerator and see if it is only zero or one elements long. - If zero-length, return Left(None). - If one-length, return the element in Left(Some(el)) - If more than one element long, return Right(enumerator) where enumerator is an Enumerator that contains *all* the input. Any already-read elements will still be included in this Enumerator.
Given a map of headers, split it into a sequence of individual headers.
Given a map of headers, split it into a sequence of individual headers.
Most headers map into a single pair in the new sequence. The exception is
the Set-Cookie
header which we split into a pair for each cookie it
contains. This allows us to work around issues with clients that can't
handle combined headers. (Also RFC6265 says multiple headers shouldn't
be folded together, which Play's API unfortunately does.)