@@ -11,19 +11,25 @@ module Network.Wai.HTTP2
11import Blaze.ByteString.Builder (Builder)
11import Blaze.ByteString.Builder (Builder)
12import qualified Network.HTTP.Types as H
12import qualified Network.HTTP.Types as H
14−import Network.Wai.Internal (Request)
14+import qualified Network.Wai.Internal as H1 (Request)
16-- | Headers sent after the end of a data stream, as defined by section 4.1.2 of
16-- | Headers sent after the end of a data stream, as defined by section 4.1.2 of
17-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
17-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
18type Trailers = H.ResponseHeaders
18type Trailers = H.ResponseHeaders
20+-- | The type of an HTTP\/2 request.
21+-- TODO(awpr): specialize this for HTTP\/2.
22+type Request = H1.Request
20-- | The HTTP\/2-aware equivalent of 'Network.Wai.Application'.
24-- | The HTTP\/2-aware equivalent of 'Network.Wai.Application'.
21−type Http2Application = Request -> (forall a. Response a -> IO a) -> IO Trailers
25+type Http2Application = Request -> Responder
23type Body a = (Builder -> IO ()) -> IO () -> IO a
27type Body a = (Builder -> IO ()) -> IO () -> IO a
25type Response a = (H.Status, H.ResponseHeaders, Body a)
29type Response a = (H.Status, H.ResponseHeaders, Body a)
31+type Responder = (forall a. Response a -> IO a) -> IO Trailers
27responseStatus :: Response a -> H.Status
33responseStatus :: Response a -> H.Status
28responseStatus (s, _, _) = s
34responseStatus (s, _, _) = s