Remove the "unrecognized UA" remote deprecation reason

This commit is contained in:
Jon Chambers
2026-03-23 16:43:44 -04:00
committed by Jon Chambers
parent 5d59538924
commit 9dc807a255
3 changed files with 4 additions and 16 deletions

View File

@@ -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();
}
}
}

View File

@@ -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())) {

View File

@@ -111,8 +111,7 @@ class RemoteDeprecationFilterTest {
minimumVersionsByPlatform,
versionsPendingDeprecationByPlatform,
blockedVersionsByPlatform,
versionsPendingBlockByPlatform,
true);
versionsPendingBlockByPlatform);
}
@ParameterizedTest