Skip to content

Update to URL.hostname as URL.host returns port as well if present in URL

Hi,
In RequestAnalyzer, I noticed new URL(url).host was used. Updated it to new URL(url).hostname in this Pull Request.

Reason: new URL(url).host can return "hostname:port" if port is present in URL, then it would not match with the mappings object map. new URL(url).hostname will always return just hostname without the port.

Example: https://b.somecdn.com:443/path/ -> host will return b.somecdn.com:443 but hostname returns just b.somecdn.com

Edited by Gokulakrishna

Merge request reports