@@ -237,23 +237,23 @@ def serve_static(self, environ, start_response):
237
237
uri = wsgiref .util .request_uri (environ )
238
238
p_uri = urlparse (uri )
239
239
f_path = os .path .join (self .site .config ['OUTPUT_FOLDER' ], * p_uri .path .split ('/' ))
240
- mimetype = mimetypes .guess_type (uri )[0 ] or b 'text/html'
240
+ mimetype = mimetypes .guess_type (uri )[0 ] or 'text/html'
241
241
242
242
if os .path .isdir (f_path ):
243
243
f_path = os .path .join (f_path , self .site .config ['INDEX_FILE' ])
244
244
245
245
if p_uri .path == '/robots.txt' :
246
- start_response (b '200 OK' , [(b 'Content-type' , 'txt/plain' )])
246
+ start_response ('200 OK' , [('Content-type' , 'txt/plain' )])
247
247
return '''User-Agent: *\n Disallow: /\n '''
248
248
elif os .path .isfile (f_path ):
249
249
with open (f_path ) as fd :
250
- start_response (b '200 OK' , [(b 'Content-type' , mimetype )])
250
+ start_response ('200 OK' , [('Content-type' , mimetype )])
251
251
return self .inject_js (mimetype , fd .read ())
252
252
elif p_uri .path == '/livereload.js' :
253
253
with open (LRJS_PATH ) as fd :
254
- start_response (b '200 OK' , [(b 'Content-type' , mimetype )])
254
+ start_response ('200 OK' , [('Content-type' , mimetype )])
255
255
return self .inject_js (mimetype , fd .read ())
256
- start_response (b '404 ERR' , [])
256
+ start_response ('404 ERR' , [])
257
257
return self .inject_js ('text/html' , ERROR_N .format (404 ).format (uri ))
258
258
259
259
def inject_js (self , mimetype , data ):
0 commit comments