when (not $ any (\ p -> p sc) [isSuccessful, isRedirection, isError])
$ abortSTM InternalServerError []
- ("The status code is not good for a final status: "
- ++ show sc)
+ $ Just ("The status code is not good for a final status: "
+ ++ show sc)
when (sc == MethodNotAllowed && getHeader "Allow" res == Nothing)
$ abortSTM InternalServerError []
- ("The status was " ++ show sc ++ " but no Allow header.")
+ $ Just ("The status was " ++ show sc ++ " but no Allow header.")
when (sc /= NotModified && isRedirection sc && getHeader "Location" res == Nothing)
$ abortSTM InternalServerError []
- ("The status code was " ++ show sc ++ " but no Location header.")
+ $ Just ("The status code was " ++ show sc ++ " but no Location header.")
when (itrRequest itr /= Nothing)
$ relyOnRequest itr
in
when (teList == [] || last teList /= "chunked")
$ abortSTM InternalServerError []
- ("Transfer-Encoding must end with `chunked' "
- ++ "because this is an HTTP/1.1 request: "
- ++ te)
+ $ Just ("Transfer-Encoding must end with `chunked' "
+ ++ "because this is an HTTP/1.1 request: "
+ ++ te)
writeItr itr itrWillChunkBody True
else
Nothing -> return ()
Just "identity" -> return ()
Just te -> abortSTM InternalServerError []
- ("Transfer-Encoding must be `identity' because "
+ $ Just ("Transfer-Encoding must be `identity' because "
++ "this is an HTTP/1.0 request: "
++ te)