mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-01 03:24:43 +00:00
Add test for invalid host name in content
Tests code added in:
d5690203 ("Fix critical exception when parsing a URL with a ]", 2020-08-08)
This commit is contained in:
parent
88c84364b3
commit
24c2f4ac39
3 changed files with 14 additions and 0 deletions
1
tests/checker/data/http_invalid_host.html
Normal file
1
tests/checker/data/http_invalid_host.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<a href="http://localhost]">urllib.parse.urlsplit ValueError</a>
|
||||
12
tests/checker/data/http_invalid_host.html.result
Normal file
12
tests/checker/data/http_invalid_host.html.result
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
url http://localhost:%(port)d/%(datadir)s/http_invalid_host.html
|
||||
cache key http://localhost:%(port)d/%(datadir)s/http_invalid_host.html
|
||||
real url http://localhost:%(port)d/%(datadir)s/http_invalid_host.html
|
||||
valid
|
||||
|
||||
url http://localhost]
|
||||
cache key None
|
||||
real url
|
||||
name urllib.parse.urlsplit ValueError
|
||||
info The URL is outside of the domain filter, checked only syntax.
|
||||
error
|
||||
|
||||
|
|
@ -43,6 +43,7 @@ class TestHttp(HttpServerTest):
|
|||
self.file_test("http_file.html", confargs=confargs)
|
||||
self.file_test("http_utf8.html", confargs=confargs)
|
||||
self.file_test("http.xhtml", confargs=confargs)
|
||||
self.file_test("http_invalid_host.html", confargs=confargs)
|
||||
|
||||
def test_status(self):
|
||||
for status in sorted(self.handler.responses.keys()):
|
||||
|
|
|
|||
Loading…
Reference in a new issue