Skip to content

Commit

Permalink
Make /_certs/ correctly blacklisted (#120); r=Ms2ger
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger authored Sep 22, 2016
1 parent b5623e5 commit 0190bc1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions manifest/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pytest

from ..utils import is_blacklisted


@pytest.mark.parametrize("url", [
"/foo",
"/tools/foo",
"/resources/foo",
"/common/foo",
"/conformance-checkers/foo",
"/_certs/foo"
])
def test_is_blacklisted(url):
assert is_blacklisted(url) is True


@pytest.mark.parametrize("url", [
"/foo/tools/bar",
"/foo/resources/bar",
"/foo/common/bar",
"/foo/conformance-checkers/bar",
"/foo/_certs/bar"
])
def test_not_is_blacklisted(url):
assert is_blacklisted(url) is False
2 changes: 1 addition & 1 deletion manifest/utils.py
Original file line number Diff line number Diff line change
@@ -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 Down

0 comments on commit 0190bc1

Please sign in to comment.