##// END OF EJS Templates
hgweb: discard Content-Type header for 304 responses (issue5844)...
Gregory Szorc -
r37846:11ee9bf2 stable
parent child Browse files
Show More
@@ -399,6 +399,12 b' class hgweb(object):'
399 399 tag = 'W/"%d"' % self.mtime
400 400 if req.headers.get('If-None-Match') == tag:
401 401 res.status = '304 Not Modified'
402 # Content-Type may be defined globally. It isn't valid on a
403 # 304, so discard it.
404 try:
405 del res.headers[b'Content-Type']
406 except KeyError:
407 pass
402 408 # Response body not allowed on 304.
403 409 res.setbodybytes('')
404 410 return res.sendresponse()
@@ -890,9 +890,7 b' HTTP 304 works with hgwebdir (issue5844)'
890 890 200 Script output follows
891 891 content-length: 2677
892 892 content-type: text/css
893 500 Internal Server Error
894 transfer-encoding: chunked
895 [1]
893 304 Not Modified
896 894
897 895 $ killdaemons.py
898 896
General Comments 0
You need to be logged in to leave comments. Login now