@@ -14,7 +14,7 @@ import qualified Data.ByteString.Lazy as L
1414import Data.ByteString.Builder (Builder)
1515import qualified Network.HTTP.Types as H
1616
17−import qualified Network.Wai.Internal as H1 (Request)
17+import Network.Wai.Internal (Request)
1818
1919-- | Headers sent after the end of a data stream, as defined by section 4.1.2 of
2020-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
@@ -29,12 +29,8 @@ data PushPromise = PushPromise
2929 , promisedHeader :: H.RequestHeaders
3030 }
3131
32−-- | The type of an HTTP\/2 request: a normal HTTP request and an action to
33−-- push streams associated with this request.
34−type Request = (H1.Request, PushPromise -> Responder -> IO Bool)
35−
3632-- | The HTTP\/2-aware equivalent of 'Network.Wai.Application'.
37−type Http2Application = Request -> Responder
33+type Http2Application = Request -> PushFunc -> Responder
3834
3935type Body a = (Builder -> IO ()) -> IO () -> IO a
4036
@@ -42,6 +38,8 @@ type RespondFunc = forall a. H.Status -> H.ResponseHeaders -> Body a -> IO a
4238
4339type Responder = RespondFunc -> IO Trailers
4440
41+type PushFunc = PushPromise -> Responder -> IO Bool
42+
4543promiseHeaders :: PushPromise -> H.RequestHeaders
4644promiseHeaders p =
4745 [ (":method", promisedMethod p)