XD-1881: Cope with ending slash in xd.home

Add safeguard against ThreadLocal being set
handle starting slash in xd home url