mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
#3731: Update cookie handling with vanilla limits and don't allow unrequested cookies
This commit is contained in:
parent
534148763f
commit
e1d4b6adc7
@ -23,7 +23,7 @@ public class CookieResponse extends DefinedPacket
|
|||||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||||
{
|
{
|
||||||
cookie = readString( buf );
|
cookie = readString( buf );
|
||||||
data = readNullable( DefinedPacket::readArray, buf );
|
data = readNullable( read -> DefinedPacket.readArray( read, 5120 ), buf );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -716,6 +716,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
|
|
||||||
throw CancelSendSignal.INSTANCE;
|
throw CancelSendSignal.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if there is no userCon we can't have a connection to a backend server that could have requested this cookie
|
||||||
|
// which means that this cookie is invalid as the proxy also has not requested it
|
||||||
|
Preconditions.checkState( userCon != null, "not requested cookie received" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user