@@ -23,10 +23,6 @@ import Network.Wai.Handler.Warp.Header
2323import Network.Wai.Handler.Warp.PackInt
2424import Numeric (showInt)
2525
26−#ifndef MIN_VERSION_http_types
27−#define MIN_VERSION_http_types(x,y,z) 1
28−#endif
29−
3026-- $setup
3127-- >>> import Test.QuickCheck
3228
@@ -116,17 +112,10 @@ checkRange (H.ByteRangeSuffix count) size = (max 0 (size - count), size - 1)
116112
117113----------------------------------------------------------------
118114
119−contentRange :: H.HeaderName
120−#if MIN_VERSION_http_types(0,9,0)
121−contentRange = H.hContentRange
122−#else
123−contentRange = "Content-Range"
124−#endif
125−
126115-- | @contentRangeHeader beg end total@ constructs a Content-Range 'H.Header'
127116-- for the range specified.
128117contentRangeHeader :: Integer -> Integer -> Integer -> H.Header
129−contentRangeHeader beg end total = (contentRange, range)
118+contentRangeHeader beg end total = (H.hContentRange, range)
130119 where
131120 range = B.pack
132121 -- building with ShowS
@@ -138,13 +127,6 @@ contentRangeHeader beg end total = (contentRange, range)
138127 ( '/'
139128 : showInt total "")
140129
141−acceptRange :: H.HeaderName
142−#if MIN_VERSION_http_types(0,9,0)
143−acceptRange = H.hAcceptRanges
144−#else
145−acceptRange = "Accept-Ranges"
146−#endif
147−
148130addContentHeaders :: H.ResponseHeaders -> Integer -> Integer -> Integer -> H.ResponseHeaders
149131addContentHeaders hs off len size
150132 | len == size = hs'
@@ -152,7 +134,7 @@ addContentHeaders hs off len size
152134 in ctrng:hs'
153135 where
154136 !lengthBS = packIntegral len
155− !hs' = (H.hContentLength, lengthBS) : (acceptRange,"bytes") : hs
137+ !hs' = (H.hContentLength, lengthBS) : (H.hAcceptRanges,"bytes") : hs
156138
157139-- |
158140--