mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
lint: tighten up HTTPS checks on URLs
This commit is contained in:
parent
4197a4a64a
commit
1c9bc32bf6
1 changed files with 5 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ options = None
|
||||||
|
|
||||||
|
|
||||||
def enforce_https(domain):
|
def enforce_https(domain):
|
||||||
return (re.compile(r'.*[^sS]://[^/]*' + re.escape(domain) + r'(/.*)?'),
|
return (re.compile(r'^[^h][^t][^t][^p][^s]://[^/]*' + re.escape(domain) + r'(/.*)?', re.IGNORECASE),
|
||||||
domain + " URLs should always use https://")
|
domain + " URLs should always use https://")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -51,6 +51,9 @@ https_enforcings = [
|
||||||
enforce_https('savannah.gnu.org'),
|
enforce_https('savannah.gnu.org'),
|
||||||
enforce_https('git.savannah.gnu.org'),
|
enforce_https('git.savannah.gnu.org'),
|
||||||
enforce_https('download.savannah.gnu.org'),
|
enforce_https('download.savannah.gnu.org'),
|
||||||
|
enforce_https('github.io'),
|
||||||
|
enforce_https('gitlab.io'),
|
||||||
|
enforce_https('githubusercontent.com'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -126,6 +129,7 @@ regex_checks = {
|
||||||
'WebSite': http_checks,
|
'WebSite': http_checks,
|
||||||
'SourceCode': http_checks,
|
'SourceCode': http_checks,
|
||||||
'Repo': https_enforcings,
|
'Repo': https_enforcings,
|
||||||
|
'UpdateCheckMode': https_enforcings,
|
||||||
'IssueTracker': http_checks + [
|
'IssueTracker': http_checks + [
|
||||||
(re.compile(r'.*github\.com/[^/]+/[^/]+/*$'),
|
(re.compile(r'.*github\.com/[^/]+/[^/]+/*$'),
|
||||||
_("/issues is missing")),
|
_("/issues is missing")),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue