Commit ce9c1099 authored by 's avatar

Fixed bug in traversal when HTTP methods that disallow acquisition are used.

parent 2f3bb364
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
# file. # file.
# #
############################################################################## ##############################################################################
__version__='$Revision: 1.2 $'[11:-2] __version__='$Revision: 1.3 $'[11:-2]
from string import join, split, find, rfind, lower, upper from string import join, split, find, rfind, lower, upper
from urllib import quote from urllib import quote
...@@ -279,14 +279,19 @@ class BaseRequest: ...@@ -279,14 +279,19 @@ class BaseRequest:
else: else:
try: try:
if baseflag and hasattr(object, 'aq_base'): if baseflag and hasattr(object, 'aq_base'):
subobject=getattr(object.aq_base, entry_name) if hasattr(object.aq_base, entry_name):
else: subobject=getattr(object,entry_name) subobject=getattr(object, entry_name)
else: raise AttributeError, entry_name
else: subobject=getattr(object, entry_name)
except AttributeError: except AttributeError:
got=1 got=1
try: subobject=object[entry_name] try: subobject=object[entry_name]
except (KeyError, IndexError, except (KeyError, IndexError,
TypeError, AttributeError): TypeError, AttributeError):
if debug_mode: if entry_name=='.': subobject=object
elif entry_name=='..' and parents:
subobject=parents[-1]
elif debug_mode:
return response.debugError( return response.debugError(
"Cannot locate object at: %s" %URL) "Cannot locate object at: %s" %URL)
else: return response.notFoundError(URL) else: return response.notFoundError(URL)
......
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