on master help sign in
Add alias of Request for HTTP2
commit8574d5722346fed63fcaca634e591648170a16fd authorAndrew Pritchard <awpr@google.com> dateThu 30 Jul 2015, 21:31 (11 years ago) parent85d166a
1 file changed+8−2
wai/Network/Wai/HTTP2.hs+8−2
wai/Network/Wai/HTTP2.hs+8−2
@@ -11,19 +11,25 @@ module Network.Wai.HTTP2
1111import Blaze.ByteString.Builder (Builder)
1212import qualified Network.HTTP.Types as H
1313
14−import Network.Wai.Internal (Request)
14+import qualified Network.Wai.Internal as H1 (Request)
1515
1616-- | Headers sent after the end of a data stream, as defined by section 4.1.2 of
1717-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
1818type Trailers = H.ResponseHeaders
1919
20+-- | The type of an HTTP\/2 request.
21+-- TODO(awpr): specialize this for HTTP\/2.
22+type Request = H1.Request
23+
2024-- | 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
2226
2327type Body a = (Builder -> IO ()) -> IO () -> IO a
2428
2529type Response a = (H.Status, H.ResponseHeaders, Body a)
2630
31+type Responder = (forall a. Response a -> IO a) -> IO Trailers
32+
2733responseStatus :: Response a -> H.Status
2834responseStatus (s, _, _) = s
2935