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
99ed90fb
Commit
99ed90fb
authored
Apr 26, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrote Python1.5 dependant code for generation of the content-length
header
parent
c42260ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
ZServer/HTTPResponse.py
ZServer/HTTPResponse.py
+3
-8
lib/python/ZServer/HTTPResponse.py
lib/python/ZServer/HTTPResponse.py
+3
-8
No files found.
ZServer/HTTPResponse.py
View file @
99ed90fb
...
@@ -147,15 +147,10 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -147,15 +147,10 @@ class ZServerHTTPResponse(HTTPResponse):
not
self
.
_streaming
:
not
self
.
_streaming
:
self
.
setHeader
(
'content-length'
,
len
(
body
))
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
)
content_length
=
headers
.
get
(
'content-length'
,
None
)
if
type
(
content_length
)
is
LongType
:
if
content_length
>
0
:
str_rep
=
str
(
content_length
)
self
.
setHeader
(
'content-length'
,
content_length
)
if
str_rep
[
-
1
:]
==
'L'
:
str_rep
=
str_rep
[:
-
1
]
self
.
setHeader
(
'content-length'
,
str_rep
)
headersl
=
[]
headersl
=
[]
append
=
headersl
.
append
append
=
headersl
.
append
...
...
lib/python/ZServer/HTTPResponse.py
View file @
99ed90fb
...
@@ -147,15 +147,10 @@ class ZServerHTTPResponse(HTTPResponse):
...
@@ -147,15 +147,10 @@ class ZServerHTTPResponse(HTTPResponse):
not
self
.
_streaming
:
not
self
.
_streaming
:
self
.
setHeader
(
'content-length'
,
len
(
body
))
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
)
content_length
=
headers
.
get
(
'content-length'
,
None
)
if
type
(
content_length
)
is
LongType
:
if
content_length
>
0
:
str_rep
=
str
(
content_length
)
self
.
setHeader
(
'content-length'
,
content_length
)
if
str_rep
[
-
1
:]
==
'L'
:
str_rep
=
str_rep
[:
-
1
]
self
.
setHeader
(
'content-length'
,
str_rep
)
headersl
=
[]
headersl
=
[]
append
=
headersl
.
append
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