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

Commit

Permalink
Make /_certs/ correctly blacklisted
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders authored and Ms2ger committed Sep 22, 2016
1 parent b5623e5 commit ebfd192
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
@@ -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
@@ -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 ebfd192

Please sign in to comment.