Make `validate_redirect_url` smarter. Fixes #261.