Commit 92eb630c authored by Alexandre's avatar Alexandre
Browse files

Add comments

parent 2d28a144
......@@ -907,6 +907,9 @@ def run_check_default(connection):
return ok
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:
return True
ok = True
......@@ -935,6 +938,10 @@ def run_check_mime(connection, accept="application/dns-message", content_type="a
return ok
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
test_name = 'Test truncated data'
if verbose:
......@@ -970,7 +977,11 @@ def run_check_trunc(connection):
if dot:
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)
print_result(connection, request, prefix=test_name, display_err=not ok)
if verbose:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment