##// END OF EJS Templates
serve: don't send any content headers with 304 responses...
Mads Kiilerich -
r18380:a4d7fd7a default
parent child Browse files
Show More
@@ -153,7 +153,8 b' class _httprequesthandler(BaseHTTPServer'
153 self.send_header(*h)
153 self.send_header(*h)
154 if h[0].lower() == 'content-length':
154 if h[0].lower() == 'content-length':
155 self.length = int(h[1])
155 self.length = int(h[1])
156 if self.length is None:
156 if (self.length is None and
157 saved_status[0] != common.HTTP_NOT_MODIFIED):
157 self._chunked = (not self.close_connection and
158 self._chunked = (not self.close_connection and
158 self.request_version == "HTTP/1.1")
159 self.request_version == "HTTP/1.1")
159 if self._chunked:
160 if self._chunked:
@@ -31,6 +31,8 b' def request(host, path, show):'
31 conn.request("GET", '/' + path, None, headers)
31 conn.request("GET", '/' + path, None, headers)
32 response = conn.getresponse()
32 response = conn.getresponse()
33 print response.status, reasons.get(response.reason, response.reason)
33 print response.status, reasons.get(response.reason, response.reason)
34 if show[:1] == ['-']:
35 show = [h for h, v in response.getheaders() if h.lower() not in show]
34 for h in [h.lower() for h in show]:
36 for h in [h.lower() for h in show]:
35 if response.getheader(h, None) is not None:
37 if response.getheader(h, None) is not None:
36 print "%s: %s" % (h, response.getheader(h))
38 print "%s: %s" % (h, response.getheader(h))
@@ -310,8 +310,10 b' Test the access/error files are opened i'
310
310
311 static file
311 static file
312
312
313 $ "$TESTDIR/get-with-headers.py" --twice localhost:$HGPORT 'static/style-gitweb.css'
313 $ "$TESTDIR/get-with-headers.py" --twice localhost:$HGPORT 'static/style-gitweb.css' - date etag server
314 200 Script output follows
314 200 Script output follows
315 content-length: 4619
316 content-type: text/css
315
317
316 body { font-family: sans-serif; font-size: 12px; margin:0px; border:solid #d9d8d1; border-width:1px; margin:10px; }
318 body { font-family: sans-serif; font-size: 12px; margin:0px; border:solid #d9d8d1; border-width:1px; margin:10px; }
317 a { color:#0000cc; }
319 a { color:#0000cc; }
General Comments 0
You need to be logged in to leave comments. Login now