on master help sign in
Add initial HTTP/2-aware Application type

This is expected to continue to evolve; for now it's nearly identical to Wai.Application, because that's the interface currently supported by Warp's HTTP/2 connection handler.

commite73cd98fd083a324e26aab3db4ff91f753d1738c authorAndrew Pritchard <awpr@google.com> dateWed 29 Jul 2015, 20:07 (11 years ago) parent8ad19ce
2 files changed+16
wai/Network/Wai/HTTP2.hs+15 wai/wai.cabal+1
wai/Network/Wai/HTTP2.hsnew file+15
@@ -0,0 +1,15 @@
1+module Network.Wai.HTTP2
2+ ( Http2Application
3+ , Trailers
4+ ) where
5+
6+import qualified Network.HTTP.Types as H
7+
8+import Network.Wai.Internal (Request, Response, ResponseReceived)
9+
10+-- | Headers sent after the end of a data stream, as defined by section 4.1.2 of
11+-- the HTTP\/1.1 spec (RFC 7230), and section 8.1 of the HTTP\/2 spec.
12+type Trailers = H.ResponseHeaders
13+
14+-- | The HTTP\/2-aware equivalent of 'Network.Wai.Application'.
15+type Http2Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived
wai/wai.cabal+1
@@ -27,6 +27,7 @@ Library
2727 , text >= 0.7
2828 , vault >= 0.3 && < 0.4
2929 Exposed-modules: Network.Wai
30+ Network.Wai.HTTP2
3031 Network.Wai.Internal
3132 ghc-options: -Wall
3233