Ultrakompakter HTTP Server
ulrich
2024-11-04 a1027d4499cfad752d6c449b407bb1f8dc4e16d2
src/de/uhilger/neon/Factory.java
@@ -19,6 +19,7 @@
import com.google.gson.Gson;
import com.sun.net.httpserver.Authenticator;
import com.sun.net.httpserver.Filter;
import com.sun.net.httpserver.HttpContext;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
@@ -199,6 +200,17 @@
        //    ctx.getAttributes().putAll(d.authenticator.attributes);
        //    fireAuthenticatorCreated(ctx, auth);
        //}
        if(cd.filter != null) {
          for(String filterClassName : cd.filter) {
            //
            Object filterObj = Class.forName(filterClassName)
                  .getDeclaredConstructor().newInstance();
            if(filterObj instanceof Filter) {
              Filter filter = (Filter) filterObj;
              ctx.getFilters().add(filter);
            }
          }
        }
        fireHandlerCreated(ctx, h);
        fireContextCreated(ctx);
      } else {