Updated to latest Protocol Version
This commit is contained in:
@@ -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", "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user