diff options
Diffstat (limited to 'python/gras/query/__init__.py')
-rw-r--r-- | python/gras/query/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/gras/query/__init__.py b/python/gras/query/__init__.py index 5789fab..e25e22d 100644 --- a/python/gras/query/__init__.py +++ b/python/gras/query/__init__.py @@ -15,11 +15,12 @@ class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): """Respond to a GET request.""" - if s.path.endswith('.xml'): + args = server_registry[s.server] + if s.path.endswith('.json'): s.send_response(200) - s.send_header("Content-type", "text/xml") + s.send_header("Content-type", "application/json") s.end_headers() - s.wfile.write(server_registry[s.server]['top_block'].query(s.path)) + s.wfile.write(args['top_block'].query(s.path)) return path = s.path if path.startswith('/'): path = path[1:] |