* Added .rst mimeType.

* Added Content-Disposition HTTP header in the StaticDataHolder
     outputHttpSource method:

         The main problem was in the resulting 'source' action filename, it was
         always source.

         Using this http header permit to specify another filename to the
         browser.

         More information on the Content-Disposition header:
             http://www.ietf.org/rfc/rfc1806.txt

   * Removed some lost TAB.
This commit is contained in:
rchantereau 2004-09-13 17:06:56 +00:00
parent e75cbbe2a5
commit 999e2673bb
1 changed files with 3 additions and 1 deletions

View File

@ -60,6 +60,7 @@ mimeTypes = {
".pem": "application/x-x509-ca-cert",
".png": "image/png",
".py": "text/x-python-src",
".rst": "x-text/restructured",
".stc": "application/vnd.sun.xml.calc.template",
".std": "application/vnd.sun.xml.draw.template",
".sti": "application/vnd.sun.xml.impress.template",
@ -130,6 +131,7 @@ class DataHolder(stations.AbstractStation):
logs.debug('Missing MIME type for "%s" using StaticDataHolder.' % self)
realClass = StaticDataHolder
else:
logs.debug("MIME: %s" % str(self.mimeType))
realClass = self.getConfigPythonClass(
"yep:pythonClass", default = None, ignoreGeneralValue = True)
if realClass is None:
@ -638,7 +640,7 @@ class StaticDataHolder(DataHolder):
if data is None:
data = self.data
environs.getVar("httpRequestHandler").outputData(
data, mimeType = self.mimeType, modificationTime = self.getModificationTime())
data, mimeType = self.mimeType, modificationTime = self.getModificationTime(), headers={"Content-Disposition":"attachment; filename=\"%s\"" % self.uriPathFragment})
class ImageHolder(StaticDataHolder):