chiark
/
gitweb
/
~ianmdlvl
/
fdroidserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4197a4a
)
lint: tighten up HTTPS checks on URLs
author
Hans-Christoph Steiner
<hans@eds.org>
Thu, 1 Mar 2018 22:24:00 +0000
(23:24 +0100)
committer
Hans-Christoph Steiner
<hans@eds.org>
Thu, 1 Mar 2018 22:38:56 +0000
(23:38 +0100)
fdroidserver/lint.py
patch
|
blob
|
history
diff --git
a/fdroidserver/lint.py
b/fdroidserver/lint.py
index b0a5cad76f93f52fb33752519bd98602e5605cf9..e746f2691ebb8e0ed19a579b476768603b8dac86 100644
(file)
--- a/
fdroidserver/lint.py
+++ b/
fdroidserver/lint.py
@@
-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('git.savannah.gnu.org'),
enforce_https('download.savannah.gnu.org'),
enforce_https('savannah.gnu.org'),
enforce_https('git.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,
'SourceCode': http_checks,
'Repo': https_enforcings,
'WebSite': http_checks,
'SourceCode': http_checks,
'Repo': https_enforcings,
+ 'UpdateCheckMode': https_enforcings,
'IssueTracker': http_checks + [
(re.compile(r'.*github\.com/[^/]+/[^/]+/*$'),
_("/issues is missing")),
'IssueTracker': http_checks + [
(re.compile(r'.*github\.com/[^/]+/[^/]+/*$'),
_("/issues is missing")),