Better compatibility on hostname matching