diff options
author | defanor <defanor@uberspace.net> | 2019-03-31 05:45:39 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2019-03-31 05:45:39 +0300 |
commit | e39c287569a20fc070b6ccdf52d339a7da1e11cf (patch) | |
tree | 7f764e3b9228da2406ffa7b77eed931b6b74d3ef /Main.hsc | |
parent | 7897035179f7eebaf149d75e772ec3d99d56708d (diff) |
Ignore credentials provided by a user, serve documents with status
code 401.
Diffstat (limited to 'Main.hsc')
-rw-r--r-- | Main.hsc | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -322,9 +322,10 @@ main = do to <- maybe 10 read <$> lookupEnv "TIMEOUT" maybe (respond 504 "") pure =<< timeout (to * 10 ^ (6 :: Int)) (case (lookup "auth" ps, baCredentials =<< BS.pack <$> ha) of + (Just "on", Nothing) -> respond 401 "" + (Just "try", Nothing) -> serve True xsltDir (connectdb "") ps + (Just "fail", _) -> serve True xsltDir (connectdb "") ps (_, Just (l, p)) -> serve False xsltDir (connectdb (connString [("user", l), ("password", p)])) ps - (Just "on", Nothing) -> respond 401 "" - (Just "try", Nothing) -> serve True xsltDir (connectdb "") ps _ -> serve False xsltDir (connectdb "") ps) |