comparison roundup/cgi/client.py @ 3069:4ef775d2c8d1

handle NotModified for non-static files (patch [SF#1095790])
author Richard Jones <richard@users.sourceforge.net>
date Wed, 05 Jan 2005 22:00:39 +0000
parents f4023f1cc1d6
children 3124e578db02
comparison
equal deleted inserted replaced
3068:c4e76c84f43d 3069:4ef775d2c8d1
1 # $Id: client.py,v 1.211 2004-12-03 22:19:41 richard Exp $ 1 # $Id: client.py,v 1.212 2005-01-05 22:00:39 richard Exp $
2 2
3 """WWW request handler (also used in the stand-alone server). 3 """WWW request handler (also used in the stand-alone server).
4 """ 4 """
5 __docformat__ = 'restructuredtext' 5 __docformat__ = 'restructuredtext'
6 6
268 if url: 268 if url:
269 self.additional_headers['Location'] = url 269 self.additional_headers['Location'] = url
270 self.response_code = 302 270 self.response_code = 302
271 self.write_html('Redirecting to <a href="%s">%s</a>'%(url, url)) 271 self.write_html('Redirecting to <a href="%s">%s</a>'%(url, url))
272 except SendFile, designator: 272 except SendFile, designator:
273 self.serve_file(designator) 273 try:
274 self.serve_file(designator)
275 except NotModified:
276 # send the 304 response
277 self.request.send_response(304)
278 self.request.end_headers()
274 except SendStaticFile, file: 279 except SendStaticFile, file:
275 try: 280 try:
276 self.serve_static_file(str(file)) 281 self.serve_static_file(str(file))
277 except NotModified: 282 except NotModified:
278 # send the 304 response 283 # send the 304 response

Roundup Issue Tracker: http://roundup-tracker.org/