Skip to content

Commit

Permalink
strip extraneous / in packageParser
Browse files Browse the repository at this point in the history
  • Loading branch information
akacase committed Jul 24, 2023
1 parent efcaa14 commit bfe8c59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Purl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ schemeParser = do

packageParser :: Parser Package
packageParser = do
void $ satisfy (== ':')
void $ satisfy (== ':') -- ':' must come after scheme
void $ optional $ try $ some (char '/') -- strip per standard extraneous '/' after ':' if present
start <- satisfy isAsciiLower -- Must start with a letter
rest <- many (satisfy isValidChar) -- Followed by any number of valid characters
let packType = T.pack (start : rest)
Expand Down

0 comments on commit bfe8c59

Please sign in to comment.