From 99ceba43a072f38b2caef8dd74cd1bfc67e517bb Mon Sep 17 00:00:00 2001 From: Neil Cowburn Date: Sat, 1 Feb 2020 08:27:20 +0000 Subject: [PATCH] Add support for snaked-cased hostnames --- Database/MongoDB/Connection.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Database/MongoDB/Connection.hs b/Database/MongoDB/Connection.hs index 5b0823c..0082543 100644 --- a/Database/MongoDB/Connection.hs +++ b/Database/MongoDB/Connection.hs @@ -86,7 +86,7 @@ readHostPortM :: (MonadFail m) => String -> m Host -- ^ Read string \"hostname:port\" as @Host hosthame (PortNumber port)@ or \"hostname\" as @host hostname@ (default port). Fail if string does not match either syntax. -- TODO: handle Service port readHostPortM = either (fail . show) return . parse parser "readHostPort" where - hostname = many1 (letter <|> digit <|> char '-' <|> char '.') + hostname = many1 (letter <|> digit <|> char '-' <|> char '.' <|> char '_') parser = do spaces h <- hostname