@@ -19,27 +19,35 @@ indexRequestHeader hdr = traverseHeader hdr requestMaxIndex requestKeyIndex
1919
2020idxContentLength,idxTransferEncoding,idxExpect :: Int
2121idxConnection,idxRange,idxHost :: Int
22−idxContentLength = 0
23−idxTransferEncoding = 1
24−idxExpect = 2
25−idxConnection = 3
26−idxRange = 4
27−idxHost = 5
22+idxIfModifiedSince,idxIfUnmodifiedSince,idxIfRange :: Int
23+idxContentLength = 0
24+idxTransferEncoding = 1
25+idxExpect = 2
26+idxConnection = 3
27+idxRange = 4
28+idxHost = 5
29+idxIfModifiedSince = 6
30+idxIfUnmodifiedSince = 7
31+idxIfRange = 8
2832
2933-- | The size for 'IndexedHeader' for HTTP Request.
3034-- From 0 to this corresponds to \"Content-Length\", \"Transfer-Encoding\",
31−-- \"Expect\", \"Connection\", \"Range\", and \"Host\".
35+-- \"Expect\", \"Connection\", \"Range\", \"Host\",
36+-- \"If-Modified-Since\", \"If-Unmodified-Since\" and \"If-Range\".
3237requestMaxIndex :: Int
33−requestMaxIndex = 5
38+requestMaxIndex = 8
3439
3540requestKeyIndex :: HeaderName -> Int
36−requestKeyIndex "content-length" = idxContentLength
37−requestKeyIndex "transfer-encoding" = idxTransferEncoding
38−requestKeyIndex "expect" = idxExpect
39−requestKeyIndex "connection" = idxConnection
40−requestKeyIndex "range" = idxRange
41−requestKeyIndex "host" = idxHost
42−requestKeyIndex _ = -1
41+requestKeyIndex "content-length" = idxContentLength
42+requestKeyIndex "transfer-encoding" = idxTransferEncoding
43+requestKeyIndex "expect" = idxExpect
44+requestKeyIndex "connection" = idxConnection
45+requestKeyIndex "range" = idxRange
46+requestKeyIndex "host" = idxHost
47+requestKeyIndex "if-modified-since" = idxIfModifiedSince
48+requestKeyIndex "if-unmodified-since" = idxIfUnmodifiedSince
49+requestKeyIndex "if-range" = idxIfRange
50+requestKeyIndex _ = -1
4351
4452defaultIndexRequestHeader :: IndexedHeader
4553defaultIndexRequestHeader = array (0,requestMaxIndex) [(i,Nothing)|i<-[0..requestMaxIndex]]