* TODO moved to Github issue systems

* Detailed JSON outout testing
master
Stephane Bortzmeyer 10 years ago
parent bc52ed7b14
commit 15ca925a1f
  1. 12
      DNSLG/__init__.py
  2. 2
      setup.py
  3. 2
      tests.sh

@ -261,7 +261,7 @@ Disallow: /
except Resolver.NoSuchDomainName:
output = "Domain %s does not exist\n" % domain
output = output.encode(self.encoding)
# TODO send back HTML if this is the expected format
# TODO send back in the requested format (see issue #11)
send_response(start_response, '404 No such domain', output, plaintype)
except Resolver.Refused:
output = "Refusal to answer for all name servers for %s\n" % domain
@ -274,21 +274,19 @@ Disallow: /
except Resolver.Timeout:
output = "No server replies for domain %s\n" % domain
output = output.encode(self.encoding)
# TODO send back HTML if this is the expected format. In
# that case, do not serialize output.
# TODO issue #11. In that case, do not serialize output.
send_response(start_response, '504 Timeout', output,
"text/plain")
except Resolver.NoPositiveAnswer:
output = "No server replies for domain %s\n" % domain
output = output.encode(self.encoding)
# TODO send back HTML if this is the expected format. In
# that case, do not serialize output.
# TODO issue #11
send_response(start_response, '504 No positive answer', output,
"text/plain")
except Resolver.UnknownError as code:
output = "Unknown error %s resolving %s\n" % (dns.rcode.to_text(int(str(code))), domain)
output = output.encode(self.encoding)
# TODO send back HTML if this is the expected format
# TODO issue #11
send_response(start_response, '500 Unknown server error', output, plaintype)
return [output]
@ -362,7 +360,7 @@ Disallow: /
# directive, 'Alias /robots.txt
# /usr/local/www/documents/robots.txt" etc.
pure_path = path[len(self.base_url):]
# TODO: content negotiation? Find the output format from Accept headers?
# TODO: content negotiation, see issue #10
return self.query(start_response, pure_path, client, format, resolver,
do_dnssec, tcp, cd, edns_size, reverse)
else:

@ -6,7 +6,7 @@ use_setuptools()
from setuptools import setup
setup(name='DNS-LG',
version='2012122301',
version='2013011601',
description='DNS Looking Glass',
license='BSD',
author='Stephane Bortzmeyer',

@ -19,8 +19,6 @@ DELAY=${DNSLG_DELAY:-0}
# TODO: test with another base
# TODO: test JSON output thoroughly with http://jsonlint.com/
delay() {
if [ $DELAY != 0 ]; then
sleep $DELAY

Loading…
Cancel
Save