Changeset 1401
- Timestamp:
- 10/19/06 18:31:40
- Files:
-
- trunk/cherrypy/lib/static.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/static.py
r1318 r1401 7 7 import os 8 8 import re 9 import stat 9 10 import time 10 11 import urllib … … 37 38 38 39 try: 39 st at= os.stat(path)40 st = os.stat(path) 40 41 except OSError: 41 42 raise cherrypy.NotFound() 42 43 43 if os.path.isdir(path): 44 # Check if path is a directory. 45 if stat.S_ISDIR(st.st_mode): 44 46 # Let the caller deal with it as they like. 45 47 raise cherrypy.NotFound() … … 47 49 # Set the Last-Modified response header, so that 48 50 # modified-since validation code can work. 49 response.headers['Last-Modified'] = http.HTTPDate(st at.st_mtime)51 response.headers['Last-Modified'] = http.HTTPDate(st.st_mtime) 50 52 cptools.validate_since() 51 53 … … 67 69 # Set Content-Length and use an iterable (file object) 68 70 # this way CP won't load the whole file in memory 69 c_len = st at.st_size71 c_len = st.st_size 70 72 bodyfile = open(path, 'rb') 71 73

