The identity URLs have a different rules for parsing,
but the code before looked for word 'identity' in
whole given URL to determine it was an identity URL.
This can conflict with a URL hostname which can contain
'identity' too.
The patch fixes that by looking for 'identity' only in
URL.path (after hostname:port part).
The patch also adds a new unit test for this case.
Change-Id: I265f4d38d81dc74b05f2af9adb6fe33db876329c
Story: 2002965
Task: 22970