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

« back to all changes in this revision

Viewing changes to ivle/dispatch/request.py

  • Committer: William Grant
  • Date: 2010-07-30 11:52:23 UTC
  • Revision ID: grantw@unimelb.edu.au-20100730115223-bcyxqpefhp514ra8
Tags: 1.0.2
ReleaseĀ 1.0.2.

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