mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-02 13:32:48 +01:00
Remove the "unrecognized UA" remote deprecation reason
This commit is contained in:
committed by
Jon Chambers
parent
5d59538924
commit
9dc807a255
@@ -16,15 +16,13 @@ public record DynamicRemoteDeprecationConfiguration(
|
||||
@NotNull Map<ClientPlatform, Semver> minimumVersions,
|
||||
@NotNull Map<ClientPlatform, Semver> versionsPendingDeprecation,
|
||||
@NotNull Map<ClientPlatform, Set<Semver>> blockedVersions,
|
||||
@NotNull Map<ClientPlatform, Set<Semver>> versionsPendingBlock,
|
||||
@NotNull Boolean unrecognizedUserAgentAllowed) {
|
||||
@NotNull Map<ClientPlatform, Set<Semver>> versionsPendingBlock) {
|
||||
|
||||
public static DynamicRemoteDeprecationConfiguration DEFAULT = new DynamicRemoteDeprecationConfiguration(
|
||||
Collections.emptyMap(),
|
||||
Collections.emptyMap(),
|
||||
Collections.emptyMap(),
|
||||
Collections.emptyMap(),
|
||||
true);
|
||||
Collections.emptyMap());
|
||||
|
||||
public DynamicRemoteDeprecationConfiguration {
|
||||
if (minimumVersions == null) {
|
||||
@@ -42,9 +40,5 @@ public record DynamicRemoteDeprecationConfiguration(
|
||||
if (versionsPendingBlock == null) {
|
||||
versionsPendingBlock = DEFAULT.versionsPendingBlock();
|
||||
}
|
||||
|
||||
if (unrecognizedUserAgentAllowed == null) {
|
||||
unrecognizedUserAgentAllowed = DEFAULT.unrecognizedUserAgentAllowed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ public class RemoteDeprecationFilter implements Filter, ServerInterceptor {
|
||||
private static final String REASON_TAG_NAME = "reason";
|
||||
private static final String EXPIRED_CLIENT_REASON = "expired";
|
||||
private static final String BLOCKED_CLIENT_REASON = "blocked";
|
||||
private static final String UNRECOGNIZED_UA_REASON = "unrecognized_user_agent";
|
||||
|
||||
public RemoteDeprecationFilter(final DynamicConfigurationManager<DynamicConfiguration> dynamicConfigurationManager) {
|
||||
this.dynamicConfigurationManager = dynamicConfigurationManager;
|
||||
@@ -110,11 +109,7 @@ public class RemoteDeprecationFilter implements Filter, ServerInterceptor {
|
||||
boolean shouldBlock = false;
|
||||
|
||||
if (userAgent == null) {
|
||||
if (configuration.unrecognizedUserAgentAllowed()) {
|
||||
return false;
|
||||
}
|
||||
recordDeprecation(null, UNRECOGNIZED_UA_REASON);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (blockedVersionsByPlatform.containsKey(userAgent.platform())) {
|
||||
|
||||
@@ -111,8 +111,7 @@ class RemoteDeprecationFilterTest {
|
||||
minimumVersionsByPlatform,
|
||||
versionsPendingDeprecationByPlatform,
|
||||
blockedVersionsByPlatform,
|
||||
versionsPendingBlockByPlatform,
|
||||
true);
|
||||
versionsPendingBlockByPlatform);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
||||
Reference in New Issue
Block a user