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
6335e28f
Commit
6335e28f
authored
Sep 15, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged fix for trailing 'L' in content-type header.
parent
89a8bf54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
lib/python/ZPublisher/HTTPResponse.py
lib/python/ZPublisher/HTTPResponse.py
+13
-3
No files found.
lib/python/ZPublisher/HTTPResponse.py
View file @
6335e28f
...
...
@@ -84,12 +84,12 @@
##############################################################################
'''CGI Response Output formatter
$Id: HTTPResponse.py,v 1.3
5 2000/08/18 16:53:44 shane
Exp $'''
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
$Id: HTTPResponse.py,v 1.3
6 2000/09/15 15:01:27 brian
Exp $'''
__version__
=
'$Revision: 1.3
6
$'
[
11
:
-
2
]
import
string
,
types
,
sys
,
regex
,
re
from
string
import
find
,
rfind
,
lower
,
upper
,
strip
,
split
,
join
,
translate
from
types
import
StringType
,
InstanceType
from
types
import
StringType
,
InstanceType
,
LongType
from
BaseResponse
import
BaseResponse
nl2sp
=
string
.
maketrans
(
'
\
n
'
,
' '
)
...
...
@@ -712,6 +712,16 @@ class HTTPResponse(BaseResponse):
not
headers
.
has_key
(
'transfer-encoding'
):
self
.
setHeader
(
'content-length'
,
len
(
body
))
# ugh - str(content-length) could be a Python long, which will
# produce a trailing 'L' :( This can go away when we move to
# Python 2.0...
content_length
=
headers
.
get
(
'content-length'
,
None
)
if
type
(
content_length
)
is
LongType
:
str_rep
=
str
(
content_length
)
if
str_rep
[
-
1
:]
==
'L'
:
str_rep
=
str_rep
[:
-
1
]
self
.
setHeader
(
'content-length'
,
str_rep
)
headersl
=
[]
append
=
headersl
.
append
...
...
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