on master help sign in
Add date to responseKeyIndex yesodweb/yesod#692
commitf8f8a0d1d1b515157f309cf6c25b4861e997ee48 authorMichael Snoyman <michael@snoyman.com> dateMon 17 Mar 2014, 08:40 (13 years ago) parent322515d
1 file changed+4−2
warp/Network/Wai/Handler/Warp/Header.hs+4−2
warp/Network/Wai/Handler/Warp/Header.hs+4−2
@@ -49,17 +49,19 @@ defaultIndexRequestHeader = array (0,requestMaxIndex) [(i,Nothing)|i<-[0..reques
4949indexResponseHeader :: ResponseHeaders -> IndexedHeader
5050indexResponseHeader hdr = traverseHeader hdr responseMaxIndex responseKeyIndex
5151
52−idxServer :: Int
52+idxServer, idxDate :: Int
5353--idxContentLength = 0
5454idxServer = 1
55+idxDate = 2
5556
5657-- | The size for 'IndexedHeader' for HTTP Response.
5758responseMaxIndex :: Int
58−responseMaxIndex = 1
59+responseMaxIndex = 2
5960
6061responseKeyIndex :: HeaderName -> Int
6162responseKeyIndex "content-length" = idxContentLength
6263responseKeyIndex "server" = idxServer
64+responseKeyIndex "date" = idxDate
6365responseKeyIndex _ = -1
6466
6567----------------------------------------------------------------