mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +03:00
lint: improve HTTPS check
It was missing some domains, so I added another rule. @IzzySoft pointed out it was redudnant, so this removes the redudant rule and fixes the original. https://gitlab.com/fdroid/fdroidserver/merge_requests/681/diffs#note_225263464
This commit is contained in:
parent
a8b7342e4c
commit
3801db064a
2 changed files with 6 additions and 6 deletions
|
|
@ -33,7 +33,7 @@ options = None
|
|||
|
||||
|
||||
def enforce_https(domain):
|
||||
return (re.compile(r'^[^h][^t][^t][^p][^s]://[^/]*' + re.escape(domain) + r'(/.*)?', re.IGNORECASE),
|
||||
return (re.compile(r'^http://([^/]*\.)?' + re.escape(domain) + r'(/.*)?', re.IGNORECASE),
|
||||
domain + " URLs should always use https://")
|
||||
|
||||
|
||||
|
|
@ -122,11 +122,9 @@ http_url_shorteners = [
|
|||
http_checks = https_enforcings + http_url_shorteners + [
|
||||
(re.compile(r'^(?!https?://)[^/]+'),
|
||||
_("URL must start with https:// or http://")),
|
||||
(re.compile(r'^http://[^.]+\.(github|gitlab)\.io/'),
|
||||
_("URL must start with https://")),
|
||||
(re.compile(r'^https://(github|gitlab)\.com(/[^/]+){2,3}\.git'),
|
||||
_("Appending .git is not necessary")),
|
||||
(re.compile(r'^https://[^/]*(github|gitlab|bitbucket|rawgit)\.[a-zA-Z]+/([^/]+/){2,3}master/'),
|
||||
(re.compile(r'^https://[^/]*(github|gitlab|bitbucket|rawgit|githubusercontent)\.[a-zA-Z]+/([^/]+/){2,3}master/'),
|
||||
_("Use /HEAD instead of /master to point at a file in the default branch")),
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue