equal
deleted
inserted
replaced
78 # |
78 # |
79 # Real production environment should use dedicated static file serving. |
79 # Real production environment should use dedicated static file serving. |
80 self._cw.set_header('last-modified', generateDateTime(os.stat(path).st_mtime)) |
80 self._cw.set_header('last-modified', generateDateTime(os.stat(path).st_mtime)) |
81 if self._cw.is_client_cache_valid(): |
81 if self._cw.is_client_cache_valid(): |
82 return '' |
82 return '' |
83 # XXX elif uri.startswith('/https/'): uri = uri[6:] |
|
84 mimetype, encoding = mimetypes.guess_type(path) |
83 mimetype, encoding = mimetypes.guess_type(path) |
85 if mimetype is None: |
84 if mimetype is None: |
86 mimetype = 'application/octet-stream' |
85 mimetype = 'application/octet-stream' |
87 self._cw.set_content_type(mimetype, osp.basename(path), encoding) |
86 self._cw.set_content_type(mimetype, osp.basename(path), encoding) |
88 with open(path, 'rb') as resource: |
87 with open(path, 'rb') as resource: |
223 """ |
222 """ |
224 |
223 |
225 __regid__ = 'fckeditor' |
224 __regid__ = 'fckeditor' |
226 |
225 |
227 def publish(self, rset=None): |
226 def publish(self, rset=None): |
228 config = self._cw.vreg.config |
227 uiprops = self._cw.vreg.config.uiprops |
229 if self._cw.https: |
|
230 uiprops = config.https_uiprops |
|
231 else: |
|
232 uiprops = config.uiprops |
|
233 relpath = self.relpath |
228 relpath = self.relpath |
234 if relpath.startswith('fckeditor/'): |
229 if relpath.startswith('fckeditor/'): |
235 relpath = relpath[len('fckeditor/'):] |
230 relpath = relpath[len('fckeditor/'):] |
236 relpath = relpath.split('?', 1)[0] |
231 relpath = relpath.split('?', 1)[0] |
237 return self.static_file(osp.join(uiprops['FCKEDITOR_PATH'], relpath)) |
232 return self.static_file(osp.join(uiprops['FCKEDITOR_PATH'], relpath)) |