Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
47ae05ff
Commit
47ae05ff
authored
Mar 30, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a url quoting bug that affected DAV DELETE calls.
parent
ac08b8ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
lib/python/webdav/Collection.py
lib/python/webdav/Collection.py
+3
-4
lib/python/webdav/Resource.py
lib/python/webdav/Resource.py
+6
-3
No files found.
lib/python/webdav/Collection.py
View file @
47ae05ff
...
...
@@ -85,12 +85,12 @@
"""WebDAV support - collection objects."""
__version__
=
'$Revision: 1.1
3
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
Globals
from
common
import
urlfix
,
rfc1123_date
from
Resource
import
Resource
from
urllib
import
unquote
class
Collection
(
Resource
):
...
...
@@ -104,7 +104,6 @@ class Collection(Resource):
__ac_permissions__
=
(
(
'Add Documents, Images, and Files'
,
(
'PUT'
,)),
# ('Add Folders', ('MKCOL',)),
(
'Delete objects'
,
(
'DELETE'
,)),
)
...
...
@@ -136,7 +135,7 @@ class Collection(Resource):
success. Note that in Zope a DELETE currently never returns 207."""
self
.
dav__init
(
REQUEST
,
RESPONSE
)
url
=
urlfix
(
REQUEST
[
'URL'
],
'DELETE'
)
name
=
filter
(
None
,
string
.
split
(
url
,
'/'
))[
-
1
]
name
=
unquote
(
filter
(
None
,
string
.
split
(
url
,
'/'
))[
-
1
])
# TODO: add lock checking here
self
.
aq_parent
.
_delObject
(
name
)
RESPONSE
.
setStatus
(
204
)
...
...
lib/python/webdav/Resource.py
View file @
47ae05ff
...
...
@@ -85,10 +85,11 @@
"""WebDAV support - resource objects."""
__version__
=
'$Revision: 1.2
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.2
5
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
mimetypes
,
davcmds
,
ExtensionClass
from
common
import
absattr
,
aq_base
,
urlfix
,
rfc1123_date
from
urllib
import
quote
,
unquote
import
Globals
class
Resource
(
ExtensionClass
.
Base
):
...
...
@@ -149,7 +150,7 @@ class Resource(ExtensionClass.Base):
RESPONSE
.
setHeader
(
'Content-Type'
,
absattr
(
self
.
content_type
))
else
:
url
=
urlfix
(
REQUEST
[
'URL'
],
'HEAD'
)
name
=
filter
(
None
,
string
.
split
(
url
,
'/'
))[
-
1
]
name
=
unquote
(
filter
(
None
,
string
.
split
(
url
,
'/'
))[
-
1
])
ct
,
ce
=
mimetypes
.
guess_type
(
name
)
# Could try harder here...
ct
=
ct
or
'application/octet-stream'
...
...
@@ -198,7 +199,7 @@ class Resource(ExtensionClass.Base):
return either 200 or 204 (No Content) to indicate success."""
self
.
dav__init
(
REQUEST
,
RESPONSE
)
url
=
urlfix
(
REQUEST
[
'URL'
],
'DELETE'
)
name
=
filter
(
None
,
string
.
split
(
url
,
'/'
))[
-
1
]
name
=
unquote
(
filter
(
None
,
string
.
split
(
url
,
'/'
))[
-
1
])
# TODO: add lock checking here
self
.
aq_parent
.
_delObject
(
name
)
RESPONSE
.
setStatus
(
204
)
...
...
@@ -256,6 +257,7 @@ class Resource(ExtensionClass.Base):
if
not
oflag
in
(
'T'
,
'F'
):
raise
'Bad Request'
,
'Invalid Overwrite header.'
path
,
name
=
os
.
path
.
split
(
dest
)
name
=
unquote
(
name
)
try
:
parent
=
REQUEST
.
resolve_url
(
path
)
except
ValueError
:
raise
'Conflict'
,
'Attempt to copy to an unknown namespace.'
...
...
@@ -312,6 +314,7 @@ class Resource(ExtensionClass.Base):
flag
=
string
.
upper
(
flag
)
body
=
REQUEST
.
get
(
'BODY'
,
''
)
path
,
name
=
os
.
path
.
split
(
dest
)
name
=
unquote
(
name
)
try
:
parent
=
REQUEST
.
resolve_url
(
path
)
except
ValueError
:
raise
'Conflict'
,
'Attempt to move to an unknown namespace.'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment