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

« back to all changes in this revision

Viewing changes to lib/common/cgirequest.py

  • Committer: mattgiuca
  • Date: 2008-06-16 06:22:45 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:773
cgirequest.py: Fixed req.path attribute, so it now DOES NOT include the
    query string part of the URI.
    (This is now consistent with the non-jail req.path. Access to the query
    string is done through req.get_fieldstorage).
    NOTE: This may break code which tries to access the query string directly.
    However all code should be using get_fieldstorage.
scripts/diffservice: Refactor so it's properly using the CGIRequest object
    rather than directly writing to CGI output and parsing query string.
    (Otherwise this code would have been broken by the above change).
    Now uses the request object and fieldstorage for input and output.

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
 
124
124
        if ('SERVER_NAME' not in os.environ or
125
125
            'REQUEST_METHOD' not in os.environ or
126
 
            'REQUEST_URI' not in os.environ):
 
126
            'SCRIPT_NAME' not in os.environ or
 
127
            'PATH_INFO' not in os.environ):
127
128
            raise Exception("No CGI environment found")
128
129
 
129
130
        # Determine if the browser used the public host name to make the
135
136
 
136
137
        # Inherit values for the input members
137
138
        self.method = os.environ['REQUEST_METHOD']
138
 
        self.uri = os.environ['REQUEST_URI']
 
139
        self.uri = os.environ['SCRIPT_NAME'] + os.environ['PATH_INFO']
139
140
        # Split the given path into the app (top-level dir) and sub-path
140
141
        # (after first stripping away the root directory)
141
142
        path = common.util.unmake_path(self.uri)