|
|
@ -131,7 +131,7 @@ Disallow: / |
|
|
|
if not format: |
|
|
|
mformat = req.accept.best_match(['text/html', 'application/xml', |
|
|
|
'application/json', 'text/dns', |
|
|
|
'text/plain', 'application/openmetrics-text']) |
|
|
|
'text/plain', 'application/openmetrics-text;version=0.0.1']) |
|
|
|
if mformat == "text/html": |
|
|
|
format = "HTML" |
|
|
|
elif mformat == "application/xml": |
|
|
@ -142,7 +142,7 @@ Disallow: / |
|
|
|
format = "ZONE" |
|
|
|
elif mformat == "text/plain": |
|
|
|
format = "TEXT" |
|
|
|
elif mformat == 'application/openmetrics-text': |
|
|
|
elif mformat == 'application/openmetrics-text;version=0.0.1': |
|
|
|
format = 'OPENMETRICS' |
|
|
|
if not mformat: |
|
|
|
output = "No suitable output format found\n" |
|
|
@ -163,7 +163,7 @@ Disallow: / |
|
|
|
elif format == "XML": |
|
|
|
mtype = 'application/xml' |
|
|
|
elif format == 'OPENMETRICS': |
|
|
|
mtype = 'text/plain; charset=%s' % self.encoding |
|
|
|
mtype = 'application/openmetrics-text; version=0.0.1; charset=%s' % self.encoding |
|
|
|
else: |
|
|
|
output = "Unsupported format \"%s\"\n" % format |
|
|
|
send_response(start_response, '400 Bad request', output, plaintype) |
|
|
|