Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
DNS testing tools
Remoh
Commits
92eb630c
Commit
92eb630c
authored
Jun 12, 2020
by
Alexandre
Browse files
Add comments
parent
2d28a144
Changes
1
Hide whitespace changes
Inline
Side-by-side
homer.py
View file @
92eb630c
...
@@ -907,6 +907,9 @@ def run_check_default(connection):
...
@@ -907,6 +907,9 @@ def run_check_default(connection):
return
ok
return
ok
def
run_check_mime
(
connection
,
accept
=
"application/dns-message"
,
content_type
=
"application/dns-message"
):
def
run_check_mime
(
connection
,
accept
=
"application/dns-message"
,
content_type
=
"application/dns-message"
):
# change the MIME value and see what happens
# based on the RFC only application/dns-message must be supported, any
# other MIME type can be also supported, but nothing is said on that
if
dot
:
if
dot
:
return
True
return
True
ok
=
True
ok
=
True
...
@@ -935,6 +938,10 @@ def run_check_mime(connection, accept="application/dns-message", content_type="a
...
@@ -935,6 +938,10 @@ def run_check_mime(connection, accept="application/dns-message", content_type="a
return
ok
return
ok
def
run_check_trunc
(
connection
):
def
run_check_trunc
(
connection
):
# send truncated DNS request to the server and expect a HTTP return code
# either equal to 200 or in the 400 range
# in case the server answers with 200, look for a FORMERR error in the DNS
# response
ok
=
True
ok
=
True
test_name
=
'Test truncated data'
test_name
=
'Test truncated data'
if
verbose
:
if
verbose
:
...
@@ -970,7 +977,11 @@ def run_check_trunc(connection):
...
@@ -970,7 +977,11 @@ def run_check_trunc(connection):
else
:
else
:
if
dot
:
if
dot
:
ok
=
False
ok
=
False
else
:
# a 400 response's status is acceptable
else
:
# only a 400 range HTTP code is acceptable
# if we send garbage to the server, it seems reasonable that it
# does not fail, which means we don't accept a 500 range HTTP
# error code (even so it means the server failed to process the
# input data)
ok
=
(
request
.
rcode
>=
400
and
request
.
rcode
<
500
)
ok
=
(
request
.
rcode
>=
400
and
request
.
rcode
<
500
)
print_result
(
connection
,
request
,
prefix
=
test_name
,
display_err
=
not
ok
)
print_result
(
connection
,
request
,
prefix
=
test_name
,
display_err
=
not
ok
)
if
verbose
:
if
verbose
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment