From ca79593d7659cd9c6dcdd38692888b26dcbef4f5 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Thu, 14 Nov 2024 14:32:32 +0000
Subject: [PATCH] Readme um Buildinfos erweitert

---
 src/de/uhilger/neon/Factory.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/de/uhilger/neon/Factory.java b/src/de/uhilger/neon/Factory.java
index 4f9e14a..14015d5 100644
--- a/src/de/uhilger/neon/Factory.java
+++ b/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 {

--
Gitblit v1.9.3