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
e42490ce
Commit
e42490ce
authored
Jun 10, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #2122: fixed missing is_proxying_match definition
in ZServer/HTTPServer
parent
1db2b8b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Products/SiteAccess/SiteRoot.py
lib/python/Products/SiteAccess/SiteRoot.py
+3
-0
lib/python/Products/SiteAccess/tests/testSiteRoot.py
lib/python/Products/SiteAccess/tests/testSiteRoot.py
+50
-0
No files found.
doc/CHANGES.txt
View file @
e42490ce
...
...
@@ -26,3 +26,6 @@ Zope Changes
- Collector #2122: fixed missing is_proxying_match definition
in ZServer/HTTPServer
- Collector 2077: fixed problem with ACTUAL_URL and SiteRoot
lib/python/Products/SiteAccess/SiteRoot.py
View file @
e42490ce
...
...
@@ -117,10 +117,13 @@ class SiteRoot(Traverser, Implicit):
if
srd
[
i
]
is
None
:
srd
[
i
]
=
request
.
environ
.
get
(
srp
,
None
)
if
srd
[
0
]
is
not
None
:
request
[
'ACTUAL_URL'
]
=
request
[
'ACTUAL_URL'
].
replace
(
request
[
'SERVER_URL'
],
srd
[
0
])
request
[
'SERVER_URL'
]
=
srd
[
0
]
request
.
_resetURLS
()
if
srd
[
1
]
is
not
None
:
old
=
request
[
'URL'
]
request
.
setVirtualRoot
(
srd
[
1
])
request
[
'ACTUAL_URL'
]
=
request
[
'ACTUAL_URL'
].
replace
(
old
,
request
[
'URL'
])
def
get_size
(
self
):
'''Make FTP happy'''
...
...
lib/python/Products/SiteAccess/tests/testSiteRoot.py
0 → 100644
View file @
e42490ce
"""SiteRoot regression tests.
These tests verify that the request URL headers, in particular ACTUAL_URL, are
set correctly when a SiteRoot is used.
See http://www.zope.org/Collectors/Zope/2077
"""
from
Testing.makerequest
import
makerequest
import
Zope2
Zope2
.
startup
()
import
transaction
import
unittest
class
SiteRootRegressions
(
unittest
.
TestCase
):
def
setUp
(
self
):
transaction
.
begin
()
self
.
app
=
makerequest
(
Zope2
.
app
())
try
:
self
.
app
.
manage_addFolder
(
'folder'
)
self
.
app
.
folder
.
manage_addProduct
[
'SiteAccess'
].
manage_addSiteRoot
(
title
=
'SiteRoot'
,
base
=
'http://test_base'
,
path
=
'/test_path'
)
self
.
app
.
REQUEST
.
set
(
'PARENTS'
,
[
self
.
app
])
self
.
app
.
REQUEST
.
traverse
(
'/folder'
)
except
:
self
.
tearDown
()
def
tearDown
(
self
):
transaction
.
abort
()
self
.
app
.
_p_jar
.
close
()
def
testRequest
(
self
):
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'SERVER_URL'
],
'http://test_base'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'URL'
],
'http://test_base/test_path/index_html'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'ACTUAL_URL'
],
'http://test_base/test_path'
)
def
testAbsoluteUrl
(
self
):
self
.
assertEqual
(
self
.
app
.
folder
.
absolute_url
(),
'http://test_base/test_path'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
SiteRootRegressions
))
return
suite
if
__name__
==
'__main__'
:
unittest
.
main
(
defaultTest
=
'test_suite'
)
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