Avoid double-sending Content-Type header
commitf45760c0c40168b2c256bae3e1c2434e2e80f81e
authorMichael Snoyman <michael@snoyman.com>
dateMon 10 May 2010, 10:29 (17 years ago)
parent5b9c913
Network/Wai/Handler/FastCGI.hs+6−1
@@ -91,8 +91,13 @@ requestBody state len = W.Source $ do
9191setHeader :: MonadFastCGI m => (W.ResponseHeader, B.ByteString) -> m ()
9292setHeader (k, v) =
9393 setResponseHeader
94− (HttpExtensionHeader $ B.unpack $ W.responseHeaderToBS k)
94+ k'
9595 (B.unpack v)
96+ where
97+ k'
98+ | k == W.ContentType = HttpContentType -- avoid double-sent c-type
99+ | otherwise = HttpExtensionHeader $ B.unpack $ W.responseHeaderToBS k
100+
96101
97102myPut :: FastCGIState -> () -> B.ByteString -> IO (Either () ())
98103myPut state _ bs = do
wai-handler-fastcgi.cabal+1−1
@@ -1,5 +1,5 @@
11name: wai-handler-fastcgi
2−version: 0.0.0
2+version: 0.0.0.1
33license: BSD3
44license-file: LICENSE
55author: Michael Snoyman <michael@snoyman.com>