Commit cdb5e381 authored by Stephane Bortzmeyer's avatar Stephane Bortzmeyer
Browse files

Small bugs in README and in error messages

parent b155db37
......@@ -198,9 +198,9 @@ install everything you need.
* `https://doh.bortzmeyer.fr/` ([Documentation](https://doh.bortzmeyer.fr/about))
* `https://doh.42l.fr/dns-query`
* `https://odvr.nic.cz/doh` ([Documentation](https://www.nic.cz/odvr/))
* `http://dns.hostux.net/dns-query`
* `https://dns.hostux.net/dns-query`
([Documentation](https://dns.hostux.net/))
* `https://ns0.ldn-fai.net/dns-query` ([Documentation in french](https://ldn-fai.net/serveur-dns-recursif-ouvert/))
* `https://ldn-fai.net/dns-query` ([Documentation in french](https://ldn-fai.net/serveur-dns-recursif-ouvert/))
* `https://dns.digitale-gesellschaft.ch/dns-query` ([Documentation in german](https://www.digitale-gesellschaft.ch/dns/))
* `https://doh.ffmuc.net` ([Documentation](https://ffmuc.net/wiki/doku.php?id=knb:dohdot_en))
......
......@@ -225,7 +225,7 @@ def do_test(connection, qname, qtype=rtype):
size = len(body)
response = dns.message.from_wire(body)
except dns.message.TrailingJunk: # Not DNS.
response = "ERROR Not proper DNS data \"%s\"" % body
response = "ERROR Not proper DNS data, trailing junk \"%s\"" % body
ok = False
except dns.name.BadLabelType: # Not DNS.
response = "ERROR Not proper DNS data (wrong path in the URL?) \"%s\"" % body[:100]
......@@ -249,8 +249,8 @@ if not monitoring:
name = None
message = None
try:
optlist, args = getopt.getopt (sys.argv[1:], "hvPker:f:d:t",
["help", "verbose", "dot", "head", "insecure", "POST", "repeat=", "file=", "delay="])
optlist, args = getopt.getopt (sys.argv[1:], "hvPkeV:r:f:d:t",
["help", "verbose", "dot", "head", "insecure", "POST", "vhost=", "repeat=", "file=", "delay="])
for option, value in optlist:
if option == "--help" or option == "-h":
usage()
......@@ -259,10 +259,12 @@ if not monitoring:
dot = True
elif option == "--verbose" or option == "-v":
verbose = True
elif option == "--head" or option == "-e":
elif option == "--HEAD" or option == "--head" or option == "-e":
head = True
elif option == "--POST" or option == "-P":
elif option == "--POST" or option == "--post" or option == "-P":
post = True
elif option == "--vhost" or option == "-V":
vhostname = value
elif option == "--insecure" or option == "-k":
insecure = True
elif option == "--repeat" or option == "-r":
......@@ -357,7 +359,7 @@ else: # Monitoring plugin
ok = True
start = time.time()
try:
if monitoring and dot and vhostname is not None:
if dot and vhostname is not None:
extracheck = vhostname
else:
extracheck = None
......@@ -397,7 +399,7 @@ for i in range (0, tests):
else:
try:
msg = msg.decode()
except UnicodeDecodeError:
except (UnicodeDecodeError, AttributeError):
pass # Sometimes, msg can be binary, or Latin-1
print("HTTP error %i: %s" % (rcode, msg), file=sys.stderr)
else:
......
Markdown is supported
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