~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-29 11:34:44 UTC
  • Revision ID: grantw@unimelb.edu.au-20100729113444-ht6s5kdcixvfubhr
Merge video and audio handlers, and reword them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
            String. The request method (eg. 'GET', 'POST', etc)
66
66
        uri (read)
67
67
            String. The path portion of the URI.
 
68
        unparsed_uri (read)
 
69
            String. The path portion of the URI, unparsed with query string.
68
70
        app (read)
69
71
            String. Name of the application specified in the URL, or None.
70
72
        path (read)
93
95
            in class Request.
94
96
        content_type (write)
95
97
            String. The Content-Type (mime type) header value.
 
98
        content_length (write)
 
99
            Integer. The number of octets to be transfered.
96
100
        location (write)
97
101
            String. Response "Location" header value. Used with HTTP redirect
98
102
            responses.
135
139
        # Inherit values for the input members
136
140
        self.method = req.method
137
141
        self.uri = req.uri
 
142
        self.unparsed_uri = req.unparsed_uri
138
143
        # Split the given path into the app (top-level dir) and sub-path
139
144
        # (after first stripping away the root directory)
140
145
        (self.app, self.path) = (ivle.util.split_path(req.uri))
145
150
        # Default values for the output members
146
151
        self.status = Request.HTTP_OK
147
152
        self.content_type = None        # Use Apache's default
 
153
        self.content_length = None        # Don't provide Content-Length
148
154
        self.location = None
149
155
        # In some cases we don't want the template JS (such as the username
150
156
        # and public FQDN) in the output HTML. In that case, set this to 0.
173
179
        # Prepare the HTTP and HTML headers before the first write is made
174
180
        if self.content_type != None:
175
181
            self.apache_req.content_type = self.content_type
 
182
        if self.content_length:
 
183
            self.apache_req.set_content_length(self.content_length)
176
184
        self.apache_req.status = self.status
177
185
        if self.location != None:
178
186
            self.apache_req.headers_out['Location'] = self.location