def _validate_url(self): url = self.get_argument("url") if not url: raise errors.UrlError("Missing url") elif url.startswith("http://") or url.startswith("https://"): return elif self.settings.get("implicit_base_url") and url.startswith("/"): return raise errors.UrlError("Unsupported protocol")
def _validate_url(self): if not self.get_argument("url"): raise errors.UrlError("Missing url") elif not self.get_argument("url").startswith("http://") \ and not self.get_argument("url").startswith("https://"): raise errors.UrlError("Unsupported protocol")