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
e15ecb45
Commit
e15ecb45
authored
Mar 27, 2001
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged api cleanup of physicalPathFromURL
parent
19a3977d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+25
-1
No files found.
lib/python/ZPublisher/HTTPRequest.py
View file @
e15ecb45
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.4
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.4
8
$'
[
11
:
-
2
]
import
regex
,
re
,
sys
,
os
,
string
,
urllib
,
time
,
whrandom
from
string
import
lower
,
atoi
,
rfind
,
split
,
strip
,
join
,
upper
,
find
...
...
@@ -246,6 +246,30 @@ class HTTPRequest(BaseRequest):
path
.
insert
(
0
,
self
[
'SERVER_URL'
])
return
join
(
path
,
'/'
)
def
physicalPathFromURL
(
self
,
URL
):
""" Convert a URL into a physical path in the current context.
If the URL makes no sense in light of the current virtual
hosting context, a ValueError is raised."""
other
=
self
.
other
bad_server_url
=
0
path
=
filter
(
None
,
split
(
URL
,
'/'
))
if
find
(
URL
,
'://'
)
>=
0
:
path
=
path
[
2
:]
# Check the path against BASEPATH1
vhbase
=
self
.
_script
vhbl
=
len
(
vhbase
)
bad_basepath
=
0
if
path
[:
vhbl
]
==
vhbase
:
path
=
path
[
vhbl
:]
else
:
raise
ValueError
,
(
'Url does not match virtual hosting context'
)
vrpp
=
other
.
get
(
'VirtualRootPhysicalPath'
,
(
''
,))
return
list
(
vrpp
)
+
map
(
unquote
,
path
)
def
_resetURLS
(
self
):
other
=
self
.
other
other
[
'URL'
]
=
join
([
other
[
'SERVER_URL'
]]
+
self
.
_script
+
...
...
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