Properly handles content negotiation failures. Closes #28

master
Stephane Bortzmeyer 10 years ago
parent 7cc562fc02
commit 5bf4fd0b63
  1. 4
      DNSLG/__init__.py
  2. 7
      tests.sh

@ -137,7 +137,9 @@ Disallow: /
elif mformat == "text/plain":
format = "TEXT"
if not mformat:
mformat = "text/html"
output = "No suitable output format found\n"
send_response(start_response, '400 Bad request', output, plaintype)
return [output]
mtype = '%s; charset=%s' % (mformat, self.encoding)
else:
if format == "TEXT" or format == "TXT":

@ -233,6 +233,13 @@ delay
# Various HTTP tricks
# This one requires curl, to have custom headers
# See issue #28
for format in application/json application/xml text/plain application/x-unknown; do
${WEB} --header "Accept: $format" ${URL}/mime.org/SOA
done
delay
# This one requires curl, to have custom headers
echo "Test methods other than GET (should be refused)"
${WEB} --head ${URL}/example.org/A

Loading…
Cancel
Save