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

« back to all changes in this revision

Viewing changes to ivle/dispatch/request.py

  • Committer: David Coles
  • Date: 2010-07-17 11:32:50 UTC
  • Revision ID: coles.david@gmail.com-20100717113250-vi18n50bcjmfmzrt
Show warning for CGI header field-names which contain restricted characters.

Forbidden characters are the separators defined by RFC3875. This is mainly to 
fix an issue where printing a dictionary (with no CGI headers) could be 
assumed to be a CGI header with no warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
            in class Request.
96
96
        content_type (write)
97
97
            String. The Content-Type (mime type) header value.
98
 
        content_length (write)
99
 
            Integer. The number of octets to be transfered.
100
98
        location (write)
101
99
            String. Response "Location" header value. Used with HTTP redirect
102
100
            responses.
150
148
        # Default values for the output members
151
149
        self.status = Request.HTTP_OK
152
150
        self.content_type = None        # Use Apache's default
153
 
        self.content_length = None        # Don't provide Content-Length
154
151
        self.location = None
155
152
        # In some cases we don't want the template JS (such as the username
156
153
        # and public FQDN) in the output HTML. In that case, set this to 0.
179
176
        # Prepare the HTTP and HTML headers before the first write is made
180
177
        if self.content_type != None:
181
178
            self.apache_req.content_type = self.content_type
182
 
        if self.content_length:
183
 
            self.apache_req.set_content_length(self.content_length)
184
179
        self.apache_req.status = self.status
185
180
        if self.location != None:
186
181
            self.apache_req.headers_out['Location'] = self.location