##// 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 tag = 'W/"%d"' % self.mtime
399 tag = 'W/"%d"' % self.mtime
400 if req.headers.get('If-None-Match') == tag:
400 if req.headers.get('If-None-Match') == tag:
401 res.status = '304 Not Modified'
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 # Response body not allowed on 304.
408 # Response body not allowed on 304.
403 res.setbodybytes('')
409 res.setbodybytes('')
404 return res.sendresponse()
410 return res.sendresponse()
@@ -890,9 +890,7 b' HTTP 304 works with hgwebdir (issue5844)'
890 200 Script output follows
890 200 Script output follows
891 content-length: 2677
891 content-length: 2677
892 content-type: text/css
892 content-type: text/css
893 500 Internal Server Error
893 304 Not Modified
894 transfer-encoding: chunked
895 [1]
896
894
897 $ killdaemons.py
895 $ killdaemons.py
898
896
General Comments 0
You need to be logged in to leave comments. Login now