File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,6 +159,10 @@ def send_head(self):
159159 headers = dict (self .headers )
160160 fs = os .stat (path )
161161
162+ self .send_header ("Content-Length" , str (fs [6 ]))
163+ self .send_header ("Last-Modified" , self .date_time_string (fs .st_mtime ))
164+ self .send_header ("Accept-Ranges" , "bytes" )
165+
162166 if 'if-modified-since' in headers :
163167 ims = headers ['if-modified-since' ]
164168 ims = parse_date (ims .split (";" )[0 ].strip ())
@@ -188,9 +192,6 @@ def send_head(self):
188192 self .send_header ("Content-type" , mimetype )
189193 #if encoding:
190194 # self.send_header("Content-Encoding", encoding)
191- self .send_header ("Content-Length" , str (fs [6 ]))
192- self .send_header ("Last-Modified" , self .date_time_string (fs .st_mtime ))
193- self .send_header ("Accept-Ranges" , "bytes" )
194195 self .end_headers ()
195196 result = StringIO ()
196197 result .write (f )
You can’t perform that action at this time.
0 commit comments