Updated to latest Protocol Version

This commit is contained in:
Finn
2026-02-01 19:28:45 +01:00
parent 09a92de292
commit 6d1decbb61
6 changed files with 21 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
package org.openautonomousconnection.webserver.api;
import org.openautonomousconnection.protocol.side.web.ConnectedWebClient;
import org.openautonomousconnection.protocol.side.server.CustomConnectedClient;
import org.openautonomousconnection.protocol.side.web.ProtocolWebServer;
import org.openautonomousconnection.protocol.side.web.managers.SessionManager;
@@ -23,14 +23,14 @@ public final class SessionContext {
this.valid = valid;
}
public static SessionContext from(ConnectedWebClient client, ProtocolWebServer server, Map<String, String> headers) throws IOException {
public static SessionContext from(CustomConnectedClient client, ProtocolWebServer server, Map<String, String> headers) throws IOException {
if (headers == null) return new SessionContext(null, null, false);
String sessionId = headers.get("session");
if (sessionId == null) return new SessionContext(null, null, false);
String ip = (client.getConnection().getSocket() != null && client.getConnection().getSocket().getInetAddress() != null)
? client.getConnection().getSocket().getInetAddress().getHostAddress() : "";
String ip = (client.getConnection().getTcpSocket() != null && client.getConnection().getTcpSocket().getInetAddress() != null)
? client.getConnection().getTcpSocket().getInetAddress().getHostAddress() : "";
String userAgent = headers.getOrDefault("user-agent", "");