[4.2] Implements Optional Fallback In URL::previous()

In case the referer header is not set.

Also added tests.