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
250169d0
Commit
250169d0
authored
Apr 28, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed to include a Host header so that the client works properly
with virtual hosts.
parent
5eb354c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
lib/python/ZPublisher/Client.py
lib/python/ZPublisher/Client.py
+7
-1
No files found.
lib/python/ZPublisher/Client.py
View file @
250169d0
...
...
@@ -103,7 +103,7 @@ that allows one to simply make a single web request.
The module also provides a command-line interface for calling objects.
"""
__version__
=
'$Revision: 1.
29
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
30
$'
[
11
:
-
2
]
import
sys
,
regex
,
socket
,
mimetools
from
httplib
import
HTTP
...
...
@@ -115,6 +115,7 @@ from base64 import encodestring
from
urllib
import
urlopen
,
quote
from
types
import
FileType
,
ListType
,
DictType
,
TupleType
from
string
import
strip
,
split
,
atoi
,
join
,
rfind
,
translate
,
maketrans
from
urlparse
import
urlparse
class
Function
:
username
=
None
...
...
@@ -129,6 +130,8 @@ class Function:
while
url
[
-
1
:]
==
'/'
:
url
=
url
[:
-
1
]
self
.
url
=
url
self
.
headers
=
headers
if
not
headers
.
has_key
(
'Host'
)
and
not
headers
.
has_key
(
'host'
):
headers
[
'Host'
]
=
split
(
urlparse
(
url
)[
1
],
':'
)[
0
]
self
.
func_name
=
url
[
rfind
(
url
,
'/'
)
+
1
:]
self
.
__dict__
[
'__name__'
]
=
self
.
func_name
self
.
func_defaults
=
()
...
...
@@ -222,6 +225,7 @@ class Function:
if
ec
==
200
:
return
(
headers
,
response
)
self
.
handleError
(
query
,
ec
,
em
,
headers
,
response
)
def
handleError
(
self
,
query
,
ec
,
em
,
headers
,
response
):
try
:
v
=
headers
.
dict
[
'bobo-exception-value'
]
except
:
v
=
ec
...
...
@@ -312,6 +316,8 @@ class Object:
**
headers
):
self
.
url
=
url
self
.
headers
=
headers
if
not
headers
.
has_key
(
'Host'
)
and
not
headers
.
has_key
(
'host'
):
headers
[
'Host'
]
=
split
(
urlparse
(
url
)[
1
],
':'
)[
0
]
if
method
is
not
None
:
self
.
method
=
method
if
username
is
not
None
:
self
.
username
=
username
if
password
is
not
None
:
self
.
password
=
password
...
...
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