Mercurial Hosting > luan
comparison src/luan/webserver/handlers/FileHandler.java @ 1148:49fb4e83484f
webserver - change headers to lower case
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 04 Feb 2018 17:11:06 -0700 |
parents | bf03d687eaff |
children | 668f29bc52ea |
comparison
equal
deleted
inserted
replaced
1147:30d87b7d1d62 | 1148:49fb4e83484f |
---|---|
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>" ); |