Skip to content

Commit

Permalink
add file name and extension to url parser
Browse files Browse the repository at this point in the history
  • Loading branch information
CattoGamer committed Oct 29, 2024
1 parent 913c865 commit 7acfc39
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ function parse(url, default)
-- path is whatever was left
if url ~= "" then
parsed.path = url

-- get file information
if string.GetFileFromFilename(url) then
parsed.file = {
name = string.GetFileFromFilename(url),
ext = string.GetExtensionFromFilename(url)
}
end
else
parsed.path = "/"
end
Expand Down

0 comments on commit 7acfc39

Please sign in to comment.