getResponseHeader :: ResponseHead
                  -> CI.CI ByteString
                  -> ByteString
getResponseHeader rsp key = case lookup key (responseHeaders rsp) of
    Just t  -> t
    Nothing -> throw $ MalformedResponse rsp $
        "Header missing: " ++ BC.unpack (CI.original key)


--------------------------------------------------------------------------------
-- | Get the @Sec-WebSocket-Version@ header
getResponseHeader :: ResponseHead
                  -> CI.CI ByteString
                  -> ByteString
getResponseHeader rsp key = case lookup key (responseHeaders rsp) of
    Just t  -> t
    Nothing -> throw $ MalformedResponse rsp $
        "Header missing: " ++ BC.unpack (CI.original key)


--------------------------------------------------------------------------------
-- | Get the @Sec-WebSocket-Version@ header
getResponseHeader rsp key = case lookup key (responseHeaders rsp) of
    Just t  -> t
    Nothing -> throw $ MalformedResponse rsp $
        "Header missing: " ++ BC.unpack (CI.original key)


--------------------------------------------------------------------------------
-- | Get the @Sec-WebSocket-Version@ header