Commits

Kirill Simonov  committed 4d09d88

Fixed `sphinxext_htsqldoc` to respect changed content type of json output.

  • Participants
  • Parent commits 2cd17e7

Comments (0)

Files changed (1)

File src/sphinxext_htsqldoc/__init__.py

 
 def load_uri(uri, error=False):
     try:
-        headers = { 'Accept': 'application/json' }
+        headers = { 'Accept': 'application/javascript' }
         request = Request(uri, headers=headers)
         response = urlopen(request)
         content_type = response.info().gettype()
 
 
 def build_result(line, content_type, content, cut=None):
-    if content_type == 'application/json':
+    if content_type == 'application/javascript':
         data = loads(content)
         if isinstance(data, dict):
             data = [[meta['title'] for meta in data['meta']]] + data['data']