Skip to content

Commit

Permalink
Merge pull request #43 from seomoz/dan/javascript-mailto-and-friends
Browse files Browse the repository at this point in the history
Handle javascript, mailto, and friends
  • Loading branch information
Dan Lecocq authored Aug 4, 2016
2 parents 0215c7c + a23a434 commit 3d5fb66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ test: url/url.so
# TODO(dan): coverage with Cython
nosetests --verbose

url/url.so: url/url.cpp url/url.pyx url/url.pxd
url/url.so: url/url.cpp url/url.pyx url/url.pxd url/url-cpp/src/*.cpp url/url-cpp/include/*.h
python setup.py build_ext --inplace

install:
Expand Down
6 changes: 6 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,12 @@ def test(rel, absolute):
yield test, rel, absolute


def test_relative_javascript():
rel = 'javascript:console.log("hello")'
base = 'http://foo.com/path'
assert_equal(rel, url.parse(rel).relative_to(base).utf8)


def test_sanitize():
def test(bad, good):
assert_equal(url.parse(bad).sanitize().utf8, good)
Expand Down
2 changes: 1 addition & 1 deletion url/url-cpp
Submodule url-cpp updated 3 files
+3 −0 include/url.h
+101 −9 src/url.cpp
+124 −19 test/test-url.cpp

0 comments on commit 3d5fb66

Please sign in to comment.