Commit c81a09c8 authored by Andreas Jung's avatar Andreas Jung

- fixes for WebDAV/FTP support

- PUT() now uses pt_edit() in order to play nicely
  with encoded text. We *except* the the encoding of the uploaded
  text is the same as the original encoding (self.output_encoding)
parent 464cbe33
...@@ -292,8 +292,9 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable, ...@@ -292,8 +292,9 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
""" Handle HTTP PUT requests """ """ Handle HTTP PUT requests """
self.dav__init(REQUEST, RESPONSE) self.dav__init(REQUEST, RESPONSE)
self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1) self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
## XXX this should be unicode or we must pass an encoding text = REQUEST.get('BODY', '')
self.pt_edit(REQUEST.get('BODY', '')) content_type = guess_type('', text)
self.pt_edit(text, content_type, self.output_encoding)
RESPONSE.setStatus(204) RESPONSE.setStatus(204)
return RESPONSE return RESPONSE
...@@ -304,8 +305,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable, ...@@ -304,8 +305,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
security.declareProtected(ftp_access, 'manage_FTPget') security.declareProtected(ftp_access, 'manage_FTPget')
def manage_FTPget(self): def manage_FTPget(self):
"Get source for FTP download" "Get source for FTP download"
self.REQUEST.RESPONSE.setHeader('Content-Type', self.content_type) return self.pt_render()
return self.read()
security.declareProtected(view_management_screens, 'html') security.declareProtected(view_management_screens, 'html')
def html(self): def html(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment