mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Made filtering work properly again.
This commit is contained in:
parent
58f8a34b49
commit
502fbd5829
@ -424,10 +424,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
final boolean allow_symlinks = configuration.getBoolean("allow-symlinks", false);
|
||||
int maxconnections = configuration.getInteger("max-sessions", 30);
|
||||
if(maxconnections < 2) maxconnections = 2;
|
||||
final ContextHandler context = new ContextHandler() {{
|
||||
this.setContextPath("/");
|
||||
this.setClassLoader(Thread.currentThread().getContextClassLoader());
|
||||
this.setHandler(router = new HandlerRouter() {{
|
||||
router = new HandlerRouter() {{
|
||||
this.addHandler("/", new ResourceHandler() {{
|
||||
this.setAliases(allow_symlinks);
|
||||
this.setWelcomeFiles(new String[] { "index.html" });
|
||||
@ -436,10 +433,10 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
}});
|
||||
this.addHandler("/tiles/", new ResourceHandler() {{
|
||||
this.setAliases(allow_symlinks);
|
||||
this.setWelcomeFiles(new String[] { });
|
||||
this.setDirectoriesListed(true);
|
||||
this.setBaseResource(createFileResource(tilesDirectory.toString()));
|
||||
}});
|
||||
}});
|
||||
}};
|
||||
|
||||
if(allow_symlinks)
|
||||
@ -458,7 +455,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
||||
/* Load customized response headers, if any */
|
||||
filters.add(new CustomHeaderFilter(configuration.getNode("http-response-headers")));
|
||||
|
||||
webServer.setHandler(/*new FilterHandler(*/context/*, filters)*/);
|
||||
webServer.setHandler(new FilterHandler(router, filters));
|
||||
|
||||
addServlet("/up/configuration", new org.dynmap.servlet.ClientConfigurationServlet(this));
|
||||
|
||||
|
@ -49,7 +49,6 @@ public class FilterHandler extends AbstractHandler {
|
||||
public void handle(final String target, final Request baseRequest, final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException {
|
||||
final Handler handler = this.getHandler();
|
||||
final Iterator<FilterHolder> iterator = getFilters().iterator();
|
||||
Log.info("Filtering..." + request.getPathInfo());
|
||||
final FilterChain chain = new FilterChain() {
|
||||
@Override
|
||||
public void doFilter(ServletRequest re, ServletResponse rs) throws IOException, ServletException {
|
||||
@ -57,7 +56,6 @@ public class FilterHandler extends AbstractHandler {
|
||||
Filter f = iterator.next().getFilter();
|
||||
f.doFilter(request, response, this);
|
||||
} else {
|
||||
Log.info("Handling...");
|
||||
handler.handle(target, baseRequest, request, response);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user