Changeset 10070 in genesis for tools/gformat.py


Ignore:
Timestamp:
Mar 9, 2012, 9:18:04 PM (13 years ago)
Author:
rick
Message:

Tell when and when not to debug properly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10069 r10070  
    618618  output = ""
    619619  if not uri[0]:
    620     if os.environ['HTTP_USER_AGENT'].startswith('fetch '):
     620    if is_text_request():
    621621      output += "Content-type:text/plain\r\n\r\n"
    622622      output += '\n'.join(get_hostlist())
     
    824824
    825825
     826def is_text_request():
     827  return os.environ['HTTP_USER_AGENT'].split()[0] in ['curl', 'fetch', 'wget']
    826828
    827829def main():
     
    943945      usage()
    944946  else:
    945     cgitb.enable()
     947    # Do not enable debugging for config requests as it highly clutters the output
     948    if not is_text_request():
     949      cgitb.enable()
    946950    process_cgi_request()
    947951
Note: See TracChangeset for help on using the changeset viewer.