IPv6 address returned from $location.host() does not include the brackets in IE/Edge #16692
Description
I'm submitting a ...
- bug report
- feature request
- other
Current behavior:
For example, when the URL is https://[fd12:3456:789a:74::27]
, $location.host()
returns fd12:3456:789a:74::27
in IE/Edge.
This is because host
and hostname
of a
tag element returns the address without bracket, when we use urlParsingNode
, and we use it in urlResolve
directly:
Lines 75 to 86 in eb0ccc6
Expected / new behavior:
$location.host()
should return the IPv6 address with the brackets. i.e. [fd12:3456:789a:74::27]
Minimal reproduction of the problem with instructions:
Call $location.host() at a IPv6 address using IE/Edge
AngularJS version: 1.7.4
Browser: [ Edge 42.17134.1.0 | IE 11.228.17134.0 ]
Anything else:
I suggest that we can check if the address is in IPv6 format, and add brackets to it if it doesn't exist. Not necessary to check if it's IE/Edge.