Add support for snaked-cased hostnames

This commit is contained in:
Neil Cowburn 2020-02-01 08:27:20 +00:00
parent 60c10bb5cc
commit 99ceba43a0
No known key found for this signature in database
GPG key ID: 4A07D4C2E3F34E66

View file

@ -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