comparison src/luan/webserver/handlers/FileHandler.java @ 1165:668f29bc52ea

clean up content-type
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 07 Feb 2018 23:16:12 -0700
parents 49fb4e83484f
children 7e6f28c769a1
comparison
equal deleted inserted replaced
1164:1f9d34a6f308 1165:668f29bc52ea
41 return response; 41 return response;
42 } 42 }
43 if( request.path.endsWith("/") && file.isDirectory() && showDirs ) { 43 if( request.path.endsWith("/") && file.isDirectory() && showDirs ) {
44 DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz"); 44 DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzz");
45 Response response = new Response(); 45 Response response = new Response();
46 response.headers.put( "content-type", "text/html; charset=UTF-8" ); 46 response.headers.put( "content-type", "text/html; charset=utf-8" );
47 Writer writer = new OutputStreamWriter( new ResponseOutputStream(response) ); 47 Writer writer = new OutputStreamWriter( new ResponseOutputStream(response) );
48 writer.write( "<!doctype html><html>" ); 48 writer.write( "<!doctype html><html>" );
49 writer.write( "<head><style>td{padding: 2px 8px}</style></head>" ); 49 writer.write( "<head><style>td{padding: 2px 8px}</style></head>" );
50 writer.write( "<body>" ); 50 writer.write( "<body>" );
51 writer.write( "<h1>Directory: "+request.path+"</h1>" ); 51 writer.write( "<h1>Directory: "+request.path+"</h1>" );