Ticket #5479: response_header.diff
File response_header.diff, 2.5 KB (added by , 17 years ago) |
---|
-
django/http/__init__.py
274 274 return self._headers.has_key(header.lower()) 275 275 276 276 __contains__ = has_header 277 278 def items(self): 279 return self._headers.items() 280 def get(self, header, alternate): 281 return self._headers.get(header, alternate) 277 282 278 283 def set_cookie(self, key, value='', max_age=None, expires=None, path='/', domain=None, secure=None): 279 284 self.cookies[key] = value -
django/core/handlers/wsgi.py
208 208 except KeyError: 209 209 status_text = 'UNKNOWN STATUS CODE' 210 210 status = '%s %s' % (response.status_code, status_text) 211 response_headers = [(str(k), str(v)) for k, v in response. headers.items()]211 response_headers = [(str(k), str(v)) for k, v in response.items()] 212 212 for c in response.cookies.values(): 213 213 response_headers.append(('Set-Cookie', str(c.output(header='')))) 214 214 start_response(status, response_headers) -
django/core/handlers/modpython.py
159 159 160 160 # Convert our custom HttpResponse object back into the mod_python req. 161 161 req.content_type = response['Content-Type'] 162 for key, value in response. headers.items():163 if key != ' Content-Type':162 for key, value in response.items(): 163 if key != 'content-type': 164 164 req.headers_out[str(key)] = str(value) 165 165 for c in response.cookies.values(): 166 166 req.headers_out.add('Set-Cookie', c.output(header='')) -
django/middleware/gzip.py
20 20 21 21 # Avoid gzipping if we've already got a content-encoding or if the 22 22 # content-type is Javascript (silly IE...) 23 is_js = "javascript" in response. headers.get('Content-Type', '').lower()23 is_js = "javascript" in response.get('Content-Type', '').lower() 24 24 if response.has_header('Content-Encoding') or is_js: 25 25 return response 26 26