Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Data/URI/Host.purs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ derive instance genericHost ∷ Generic Host _
instance showHost ∷ Show Host where show = genericShow

parser ∷ Parser Host
parser = ipv6AddressParser <|> ipv4AddressParser <|> try regNameParser
parser = try ipv6AddressParser <|> try ipv4AddressParser <|> regNameParser

-- TODO: this is much too forgiving right now
ipv6AddressParser ∷ Parser Host
Expand Down
10 changes: 10 additions & 0 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ main = runTest $ suite "Data.URI" do
Nothing)
Nothing
Nothing))
testIsoURIRef
"https://1a.example.com"
(Left
(URI
(Just (Scheme "https"))
(HierarchicalPart
(Just (Authority Nothing [(Tuple (NameAddress "1a.example.com") Nothing)]))
Nothing)
Nothing
Nothing))
testIsoURIRef
"http://en.wikipedia.org/wiki/URI_scheme"
(Left
Expand Down