fix substring with host header