@@ -23,10 +23,6 @@ import Network.Wai.Handler.Warp.Header
23import Network.Wai.Handler.Warp.PackInt
23import Network.Wai.Handler.Warp.PackInt
24import Numeric (showInt)
24import Numeric (showInt)
26−#ifndef MIN_VERSION_http_types
27−#define MIN_VERSION_http_types(x,y,z) 1
31-- >>> import Test.QuickCheck
27-- >>> import Test.QuickCheck
@@ -116,17 +112,10 @@ checkRange (H.ByteRangeSuffix count) size = (max 0 (size - count), size - 1)
117----------------------------------------------------------------
113----------------------------------------------------------------
119−contentRange :: H.HeaderName
120−#if MIN_VERSION_http_types(0,9,0)
121−contentRange = H.hContentRange
123−contentRange = "Content-Range"
126-- | @contentRangeHeader beg end total@ constructs a Content-Range 'H.Header'
115-- | @contentRangeHeader beg end total@ constructs a Content-Range 'H.Header'
127-- for the range specified.
116-- for the range specified.
128contentRangeHeader :: Integer -> Integer -> Integer -> H.Header
117contentRangeHeader :: Integer -> Integer -> Integer -> H.Header
129−contentRangeHeader beg end total = (contentRange, range)
118+contentRangeHeader beg end total = (H.hContentRange, range)
131 range = B.pack
120 range = B.pack
132 -- building with ShowS
121 -- building with ShowS
@@ -138,13 +127,6 @@ contentRangeHeader beg end total = (contentRange, range)
139 : showInt total "")
128 : showInt total "")
141−acceptRange :: H.HeaderName
142−#if MIN_VERSION_http_types(0,9,0)
143−acceptRange = H.hAcceptRanges
145−acceptRange = "Accept-Ranges"
148addContentHeaders :: H.ResponseHeaders -> Integer -> Integer -> Integer -> H.ResponseHeaders
130addContentHeaders :: H.ResponseHeaders -> Integer -> Integer -> Integer -> H.ResponseHeaders
149addContentHeaders hs off len size
131addContentHeaders hs off len size
150 | len == size = hs'
132 | len == size = hs'
@@ -152,7 +134,7 @@ addContentHeaders hs off len size
152 in ctrng:hs'
134 in ctrng:hs'
154 !lengthBS = packIntegral len
136 !lengthBS = packIntegral len
155− !hs' = (H.hContentLength, lengthBS) : (acceptRange,"bytes") : hs
137+ !hs' = (H.hContentLength, lengthBS) : (H.hAcceptRanges,"bytes") : hs