Verified Commit 2aaecce1 authored by Yannick Schinko's avatar Yannick Schinko
Browse files

Don't force index.html in URL

parent a56e9d1d
Pipeline #403 passed with stages
in 1 minute and 36 seconds
......@@ -26,15 +26,16 @@ public class StaticFileHandler implements IHandler {
@Override
public void handle(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
//Check for index
final String path = webDir + File.separator + request.uri();
String path = webDir + File.separator + request.uri();
final String uri = request.uri();
//Check for index
if (uri.endsWith("/")) {
for (String index : indexFiles) {
File checkFile = new File(path, index);
if (checkFile.exists()) {
HandlerUtil.sendRedirect(ctx, uri + index);
return;
path = checkFile.toString();
break;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment