Package dev.relism.flash.http1
Class Http1KeepAlive
java.lang.Object
dev.relism.flash.http1.Http1KeepAlive
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 Summary
Modifier and TypeMethodDescriptionstatic booleanconnectionContainsToken(Request request, String token) Whether the request'sConnectionheader liststoken(case-insensitive).static booleanisKeepAlive(Request request) Whether the connection should remain open after this response.static booleantokenEqualsIgnoreCase(dev.relism.fpr.core.ByteView view, int start, int end, String token) Case-insensitive compare ofview[start, end), trimming trailing spaces, againsttoken.static booleantokenListContains(dev.relism.fpr.core.ByteView view, String token) Scans a comma-separated token list fortoken(case-insensitive, OWS-tolerant).
-
Method Details
-
isKeepAlive
Whether the connection should remain open after this response. HTTP/1.1 defaults to keep-alive unlessConnectionlistsclose; HTTP/1.0 defaults to close unless it listskeep-alive. -
connectionContainsToken
Whether the request'sConnectionheader liststoken(case-insensitive). -
tokenListContains
Scans a comma-separated token list fortoken(case-insensitive, OWS-tolerant). -
tokenEqualsIgnoreCase
public static boolean tokenEqualsIgnoreCase(dev.relism.fpr.core.ByteView view, int start, int end, String token) Case-insensitive compare ofview[start, end), trimming trailing spaces, againsttoken.
-