Class Http1KeepAlive

java.lang.Object
dev.relism.flash.http1.Http1KeepAlive

public final class Http1KeepAlive extends Object
HTTP/1.1 keep-alive decision (RFC 9110 §7.6.1) and the shared Connection header token-list scanner both it and WebSocket upgrade detection need. (e.g. "Connection: keep-alive, Upgrade"), not a single value — a whole-value compare against "close" misses exactly that case. tokenListContains(dev.relism.fpr.core.ByteView, java.lang.String) is the one scanner both this class's isKeepAlive(dev.relism.flash.models.Request) and WebSocketUpgrade's Connection: Upgrade check use, so the two can never drift apart again.
  • Method Details

    • isKeepAlive

      public static boolean isKeepAlive(Request request)
      Whether the connection should remain open after this response. HTTP/1.1 defaults to keep-alive unless Connection lists close; HTTP/1.0 defaults to close unless it lists keep-alive.
    • connectionContainsToken

      public static boolean connectionContainsToken(Request request, String token)
      Whether the request's Connection header lists token (case-insensitive).
    • tokenListContains

      public static boolean tokenListContains(dev.relism.fpr.core.ByteView view, String token)
      Scans a comma-separated token list for token (case-insensitive, OWS-tolerant).
    • tokenEqualsIgnoreCase

      public static boolean tokenEqualsIgnoreCase(dev.relism.fpr.core.ByteView view, int start, int end, String token)
      Case-insensitive compare of view[start, end), trimming trailing spaces, against token.