diff --git a/avaje-jex/src/main/java/io/avaje/jex/Context.java b/avaje-jex/src/main/java/io/avaje/jex/Context.java index 2e556b07..6ba2bcf2 100644 --- a/avaje-jex/src/main/java/io/avaje/jex/Context.java +++ b/avaje-jex/src/main/java/io/avaje/jex/Context.java @@ -361,7 +361,15 @@ default Context render(String name) { */ String protocol(); - class Cookie { + /** + * Gets basic-auth credentials from the request, or throws. + * + *

Returns a wrapper object containing the Base64 decoded username + * and password from the Authorization header, or null if basic-auth is not properly configured + */ + BasicAuthCredentials basicAuthCredentials(); + + final class Cookie { private static final ZonedDateTime EXPIRED = ZonedDateTime.of(LocalDateTime.of(2000, 1, 1, 0, 0, 0), ZoneId.of("GMT")); private static final DateTimeFormatter RFC_1123_DATE_TIME = DateTimeFormatter.RFC_1123_DATE_TIME; private static final String PARAM_SEPARATOR = "; "; @@ -375,7 +383,7 @@ class Cookie { private boolean httpOnly; private Cookie(String name, String value) { - if (name == null || name.length() == 0) { + if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name required"); } this.name = name; @@ -492,12 +500,4 @@ public String toString() { } } - /** - * Gets basic-auth credentials from the request, or throws. - * - *

Returns a wrapper object containing the Base64 decoded username - * and password from the Authorization header, or null if basic-auth is not properly configured - */ - BasicAuthCredentials basicAuthCredentials(); - } diff --git a/avaje-jex/src/main/java/io/avaje/jex/DJexConfig.java b/avaje-jex/src/main/java/io/avaje/jex/DJexConfig.java index 68ba543c..f9e3fd5c 100644 --- a/avaje-jex/src/main/java/io/avaje/jex/DJexConfig.java +++ b/avaje-jex/src/main/java/io/avaje/jex/DJexConfig.java @@ -73,12 +73,10 @@ public JexConfig renderer(String extension, TemplateRender renderer) { @Override public ThreadFactory threadFactory() { - if (factory == null) { factory = Thread.ofVirtual().name("avaje-jex-http-", 0).factory(); } - return factory; } @@ -130,7 +128,6 @@ public Map renderers() { @Override public SSLContext sslContext() { - return this.sslContext; } diff --git a/avaje-jex/src/main/java/io/avaje/jex/DefaultRouting.java b/avaje-jex/src/main/java/io/avaje/jex/DefaultRouting.java index c0ef2a59..84e4cd7c 100644 --- a/avaje-jex/src/main/java/io/avaje/jex/DefaultRouting.java +++ b/avaje-jex/src/main/java/io/avaje/jex/DefaultRouting.java @@ -10,10 +10,6 @@ import java.util.Map; import java.util.Set; -import io.avaje.jex.Routing.Entry; -import io.avaje.jex.Routing.Group; -import io.avaje.jex.Routing.HttpService; -import io.avaje.jex.Routing.Type; import io.avaje.jex.security.Role; final class DefaultRouting implements Routing { diff --git a/avaje-jex/src/main/java/io/avaje/jex/HttpFilter.java b/avaje-jex/src/main/java/io/avaje/jex/HttpFilter.java index d52b6539..982cff0a 100644 --- a/avaje-jex/src/main/java/io/avaje/jex/HttpFilter.java +++ b/avaje-jex/src/main/java/io/avaje/jex/HttpFilter.java @@ -2,15 +2,13 @@ import java.io.IOException; -import com.sun.net.httpserver.Filter.Chain; - /** * A filter used to pre- and post-process incoming requests. Pre-processing occurs before the * application's exchange handler is invoked, and post-processing occurs after the exchange handler * returns. Filters are organized in chains, and are associated with {@link Context} instances. * *

Each {@code HttpFilter} in the chain, invokes the next filter within its own {@link - * #filter(Context, Chain)} implementation. The final {@code HttpFilter} in the chain invokes the + * #filter(Context, FilterChain)} implementation. The final {@code HttpFilter} in the chain invokes the * applications exchange handler. */ @FunctionalInterface @@ -26,7 +24,7 @@ public interface HttpFilter { *

    *
  1. Invoke the next filter in the chain, by calling {@link FilterChain#proceed}. *
  2. Terminate the chain of invocation, by not calling {@link - * FilterChain#filter}. + * FilterChain#proceed()}. *
*
  • If option 1. above is taken, then when filter() returns all subsequent filters in the * Chain have been called, and the response headers can be examined or modified.