Commit 3362eb76 authored by Andreas Jung's avatar Andreas Jung

backport of webdav compatibility fixes from 2.5 (lock-token header

missing when locking objects)
parent 8732f7f4
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"""WebDAV support - null resource objects.""" """WebDAV support - null resource objects."""
__version__='$Revision: 1.38 $'[11:-2] __version__='$Revision: 1.39 $'[11:-2]
import sys, os, mimetypes, Globals, davcmds import sys, os, mimetypes, Globals, davcmds
import Acquisition, OFS.content_types import Acquisition, OFS.content_types
...@@ -205,6 +205,7 @@ class NullResource(Persistent, Acquisition.Implicit, Resource): ...@@ -205,6 +205,7 @@ class NullResource(Persistent, Acquisition.Implicit, Resource):
lock = locknull.wl_getLock(token) lock = locknull.wl_getLock(token)
RESPONSE.setStatus(200) RESPONSE.setStatus(200)
RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"') RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"')
RESPONSE.setHeader('Lock-Token', 'opaquelocktoken:' + token)
RESPONSE.setBody(lock.asXML()) RESPONSE.setBody(lock.asXML())
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"""WebDAV support - resource objects.""" """WebDAV support - resource objects."""
__version__='$Revision: 1.52 $'[11:-2] __version__='$Revision: 1.53 $'[11:-2]
import sys, os, mimetypes, davcmds, ExtensionClass, Lockable import sys, os, mimetypes, davcmds, ExtensionClass, Lockable
from common import absattr, aq_base, urlfix, rfc1123_date, tokenFinder, urlbase from common import absattr, aq_base, urlfix, rfc1123_date, tokenFinder, urlbase
...@@ -499,6 +499,7 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem): ...@@ -499,6 +499,7 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
lock = self.wl_getLock(token) lock = self.wl_getLock(token)
RESPONSE.setStatus(200) RESPONSE.setStatus(200)
RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"') RESPONSE.setHeader('Content-Type', 'text/xml; charset="utf-8"')
RESPONSE.setHeader('Lock-Token', 'opaquelocktoken:' + token)
RESPONSE.setBody(lock.asXML()) RESPONSE.setBody(lock.asXML())
else: else:
# There's no body, so this likely to be a refresh request # There's no body, so this likely to be a refresh request
......
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