always use fileUTF in example.FileServer

This commit is contained in:
Daniella / Tove 2022-07-09 11:25:02 +02:00
parent 75a88a4c41
commit 41929aca4a

View file

@ -62,7 +62,7 @@ public class FileServer implements IRequestCatcher, RequestHandler.Listener {
if(new File(s + "/index.html").exists()) if(new File(s + "/index.html").exists())
s += "/index.html"; s += "/index.html";
if(!s.endsWith(".html") && !s.endsWith(".htm") && !(new File(s).isDirectory())) { if(!s.endsWith(".html") && !s.endsWith(".htm") && !(new File(s).isDirectory())) {
r = request.context.file(s, data.getBoolean("autoindex") ? request.realPath : null); r = request.context.fileUTF(s, data.getBoolean("autoindex") ? request.realPath : null);
r = "<pre>" + r.replace("<", "&lt;").replace(">", "&gt;") + "</pre>"; r = "<pre>" + r.replace("<", "&lt;").replace(">", "&gt;") + "</pre>";
} }
else else