Addressed Bikas' comments. The bug of ==/!= was fixed. In the future,
whenever it is to judge whether the hostname is of any location,
ResourceRequest#isAnyLocation should be called.