parent
571ab4b8f7
commit
2cb444f250
1 changed files with 5 additions and 1 deletions
|
@ -141,13 +141,17 @@ checkUrl filePath url
|
|||
| hasProtocol url = skip "Unknown protocol, skipping"
|
||||
| otherwise = checkInternalUrl filePath url
|
||||
where
|
||||
hasProtocol = all (`elem` validProtoChars) . takeWhile (/= ':')
|
||||
validProtoChars = ['A'..'Z'] ++ ['a'..'z'] ++ ['0'..'9'] ++ "+-."
|
||||
hasProtocol str = case break (== ':') str of
|
||||
(proto, ':' : _) -> all (`elem` validProtoChars) proto
|
||||
_ -> False
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
ok :: String -> Checker ()
|
||||
ok _ = tell $ mempty {checkerOk = 1}
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
skip :: String -> Checker ()
|
||||
skip reason = do
|
||||
|
|
Loading…
Reference in a new issue