mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Removes dot and dot-dot path segments from parsed URLs
This commit is contained in:
parent
4303c2f6ea
commit
fcac8c6e28
1 changed files with 3 additions and 0 deletions
|
|
@ -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("^[^%.]-%.(.*)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue