diff options
author | visteya <none@none> | 2009-06-10 18:04:19 +0000 |
---|---|---|
committer | visteya <none@none> | 2009-06-10 18:04:19 +0000 |
commit | 8df37a4222595e147a43d4e7664da423bdb4fced (patch) | |
tree | 1d8b750d7a8c71a1df9a6b55f2b70ae8d56c28d0 /cherrypy/lib/static.py | |
parent | 3e6372eb2e6273ee0c0c406be44c404243e0c4f6 (diff) | |
download | cherrypy-git-8df37a4222595e147a43d4e7664da423bdb4fced.tar.gz |
Added a cautionary note to the docstring for serve_fileobj(), regarding the seek() performed on the file object when the request has a 'Range' header, and how this may result in incorrect behavior.
Diffstat (limited to 'cherrypy/lib/static.py')
-rw-r--r-- | cherrypy/lib/static.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cherrypy/lib/static.py b/cherrypy/lib/static.py index 47d41748..697fa8e8 100644 --- a/cherrypy/lib/static.py +++ b/cherrypy/lib/static.py @@ -85,6 +85,13 @@ def serve_fileobj(fileobj, content_type=None, disposition=None, name=None): to "<disposition>; filename=<name>". If name is None, 'filename' will not be set. If disposition is None, no Content-Disposition header will be written. + + CAUTION: If the request contains a 'Range' header, one or more seek()s will + be performed on the file object. This may cause undesired behavior if + the file object is not seekable. It could also produce undesired results + if the caller set the read position of the file object prior to calling + serve_fileobj(), expecting that the data would be served starting from that + position. """ response = cherrypy.response |