Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Commit

Permalink
Remove the odd "/" special-case in is_blacklsited
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders authored and Ms2ger committed Sep 22, 2016
1 parent 5402e7a commit aa41b36
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions manifest/utils.py
@@ -1,7 +1,7 @@
import os
from six import BytesIO

blacklist = ["/", "/tools/", "/resources/", "/common/", "/conformance-checkers/", "_certs"]
blacklist = ["/tools/", "/resources/", "/common/", "/conformance-checkers/", "_certs"]

def rel_path_to_url(rel_path, url_base="/"):
assert not os.path.isabs(rel_path)
Expand All @@ -12,11 +12,10 @@ def rel_path_to_url(rel_path, url_base="/"):
return url_base + rel_path.replace(os.sep, "/")

def is_blacklisted(url):
if "/" not in url[1:]:
return True
for item in blacklist:
if item == "/":
if "/" not in url[1:]:
return True
elif url.startswith(item):
if url.startswith(item):
return True
return False

Expand Down

0 comments on commit aa41b36

Please sign in to comment.