expand range of acceptable redirection codes

This commit is contained in:
Mark Wotton 2016-03-21 13:43:36 -04:00
parent 29c335af56
commit f381c69449

View File

@ -706,7 +706,7 @@ followRedirect = do
case mr of
Nothing -> return $ Left "no response, so no redirect to follow"
Just r -> do
if not ((H.statusCode $ simpleStatus r) `elem` [301,303])
if not ((H.statusCode $ simpleStatus r) `elem` [301, 302, 303, 307, 308])
then return $ Left "followRedirect called, but previous request was not a redirect"
else do
case lookup "Location" (simpleHeaders r) of