mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 21:21:31 +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.
|
-- and is simpler for now.
|
||||||
self.file = self.raw:match("^http[s]?://[^:/]*[:]?%d*(/[^#]*)") or '/'
|
self.file = self.raw:match("^http[s]?://[^:/]*[:]?%d*(/[^#]*)") or '/'
|
||||||
self.path = parsed.path
|
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 "/"
|
self.dir = self.path:match("^(.+%/)") or "/"
|
||||||
-- TODO: Use public suffix list to extract domain
|
-- TODO: Use public suffix list to extract domain
|
||||||
self.domain= self.host:match("^[^%.]-%.(.*)")
|
self.domain= self.host:match("^[^%.]-%.(.*)")
|
||||||
|
|||||||
Reference in New Issue
Block a user