this seems weird logic to me - why is this logic applied only when url is a different protocol?