Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
lib: add support for the HEAD HTTP method
· 94dae912
Julien Cristau
authored
Jul 06, 2018
Fixes
#3
94dae912
Merge branch 'jcristau/security-tracker-head'
· 470c60f5
Salvatore Bonaccorso
authored
Jul 07, 2018
470c60f5
Show whitespace changes
Inline
Side-by-side
lib/python/web_support.py
View file @
470c60f5
...
...
@@ -664,6 +664,7 @@ class HTMLResult(Result):
self
.
headers
[
'
Content-Length
'
]
=
str
(
len
(
buf
))
def
later
(
req
):
headers_later
(
req
)
if
req
.
command
!=
'
HEAD
'
:
req
.
wfile
.
write
(
buf
)
return
later
...
...
@@ -686,6 +687,7 @@ class BinaryResult(Result):
headers_later
=
super
(
BinaryResult
,
self
).
flatten_later
()
def
later
(
req
):
headers_later
(
req
)
if
req
.
command
!=
'
HEAD
'
:
req
.
wfile
.
write
(
self
.
contents
)
return
later
...
...
@@ -804,6 +806,7 @@ class WebServiceHTTP(WebServiceBase):
finally
:
service_self
.
lock
.
release
()
result
(
self
)
do_HEAD
=
do_GET
def
__parse_path
(
self
):
pos
=
self
.
path
.
find
(
'
?
'
)
...
...