* Fix a bug when using methods other than GET.

* Still have to implement HEAD (issue #1)
master
Stephane Bortzmeyer 10 years ago
parent d192ca1a66
commit a809e1468c
  1. 2
      DNSLG/__init__.py
  2. 7
      tests.sh

@ -297,6 +297,8 @@ Disallow: /
return [output]
def application(self, environ, start_response):
plaintype = 'text/plain; charset=%s' % self.encoding
# TODO see issue #1 about HEAD support
if environ['REQUEST_METHOD'] != 'GET':
output = environ['REQUEST_METHOD']
send_response(start_response, '405 Method not allowed', output, plaintype)

@ -193,3 +193,10 @@ echo "Test with broken domains (all NS unreachable, for instance)"
${WEB} ${URL}/lame.broken-on-purpose.generic-nic.net/SOA?format=text
${WEB} ${URL}/lame2.broken-on-purpose.generic-nic.net/SOA?format=text
echo ""
# Various HTTP tricks
# This one requires curl, to have custom headers
echo Test methods other than GET (should be refused)
curl --head ${URL}/example.org/A
curl --data STUFF ${URL}/example.org/A

Loading…
Cancel
Save