~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to src/apps/debuginfo/__init__.py

  • Committer: mattgiuca
  • Date: 2007-12-17 04:49:48 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:72
debuginfo: Prints out CGI environment and other hidden properties from the
    Apache request object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        ("default_app", conf.default_app),
46
46
    ])
47
47
 
 
48
    print_table(req, "Available Applications", conf.apps.app_url.items())
 
49
 
48
50
    print_table(req, "Request Properties", [
49
51
        ("uri", req.uri),
50
52
        ("app", req.app),
51
53
        ("path", req.path),
52
54
    ])
53
55
 
54
 
    print_table(req, "Available Applications", conf.apps.app_url.items())
 
56
    # Violate encapsulation here to print out the hidden properties
 
57
    print_table(req, "Apache (Hidden) Request Properties", [
 
58
        ("hostname", req.apache_req.hostname),
 
59
        ("method", req.apache_req.method),
 
60
        ("unparsed_uri", req.apache_req.unparsed_uri),
 
61
        ("parsed_uri", req.apache_req.parsed_uri),
 
62
        ("uri", req.apache_req.uri),
 
63
        ("filename", req.apache_req.filename),
 
64
        ("path_info", req.apache_req.path_info),
 
65
    ])
55
66
 
56
 
    print_table(req, "Environment Variables", os.environ.items())
 
67
    print_table(req, "HTTP Request Headers",
 
68
        req.apache_req.headers_in.items())
 
69
    req.apache_req.add_common_vars()
 
70
    print_table(req, "CGI Environment Variables",
 
71
        req.apache_req.subprocess_env.items())
 
72
    print_table(req, "Server Environment Variables", os.environ.items())
57
73
 
58
74
    req.write("<h3>Removal instructions</h3>\n")
59
75
    req.write("""<p>In a production environment, debuginfo should be disabled.