Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jun 3, 2021
1 parent 62d3f2e commit 0a91bb5
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions baseframe/forms/validators.py
Expand Up @@ -530,11 +530,11 @@ def check_url(
rurl,
timeout=30,
allow_redirects=False,
verify=False,
verify=False, # skipcq: BAN-B501
headers={'User-Agent': self.user_agent},
)
code = r.status_code
if code >= 300 and code < 400:
if 300 <= code < 400:
# Redirect. What kind?
if rurl == r.url:
# Redirect to self in a loop, break immediately
Expand All @@ -543,10 +543,9 @@ def check_url(
# Not a loop, continue following redirects
rurl = r.url
continue
else:
# Not a redirect, break iterations and check the response
rurl = r.url
break
# Not a redirect, break iterations and check the response
rurl = r.url
break
except (
# Still a relative URL? Must be broken
requests.exceptions.MissingSchema,
Expand Down

0 comments on commit 0a91bb5

Please sign in to comment.