mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Removes dot and dot-dot path segments from parsed URLs
This commit is contained in:
@@ -433,6 +433,9 @@ URL = {
|
||||
-- and is simpler for now.
|
||||
self.file = self.raw:match("^http[s]?://[^:/]*[:]?%d*(/[^#]*)") or '/'
|
||||
self.path = parsed.path
|
||||
-- Normalize the values; removes dot and dot-dot path segments
|
||||
self.file = url.absolute("", self.file)
|
||||
self.path = url.absolute("", self.path)
|
||||
self.dir = self.path:match("^(.+%/)") or "/"
|
||||
-- TODO: Use public suffix list to extract domain
|
||||
self.domain= self.host:match("^[^%.]-%.(.*)")
|
||||
|
||||
Reference in New Issue
Block a user