1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
*** ../mod_python-3.1.3/lib/python/mod_python/publisher.py Wed Feb 9 08:41:43 2005
--- lib/python/mod_python/publisher.py Wed Feb 9 08:53:15 2005
***************
*** 258,270 ****
(period) to find the last one we're looking for.
"""
! for obj_str in object_str.split('.'):
! obj = getattr(obj, obj_str)
! # object cannot be a module
! if type(obj) == ModuleType:
raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
realm, user, passwd = process_auth(req, obj, realm,
user, passwd)
--- 258,282 ----
(period) to find the last one we're looking for.
"""
! parts = object_str.split('.')
! for n in range(len(parts)):
!
! obj = getattr(obj, parts[n])
! obj_type = type(obj)
!
! # object cannot be a module or a class
! if obj_type in [ClassType, ModuleType]:
raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
+ if n < (len(parts)-1):
+
+ # all but the last object ...
+
+ # ...must be instance
+ if obj_type != InstanceType:
+ raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
+
realm, user, passwd = process_auth(req, obj, realm,
user, passwd)
|