mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 14:27:59 +01:00
Introduce a distinct UA for server-generated messages
This commit is contained in:
committed by
Jon Chambers
parent
c03d63acb8
commit
6013d00654
@@ -8,6 +8,8 @@ package org.whispersystems.textsecuregcm.metrics;
|
||||
import io.micrometer.core.instrument.Tag;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import org.whispersystems.textsecuregcm.WhisperServerVersion;
|
||||
import org.whispersystems.textsecuregcm.storage.ClientReleaseManager;
|
||||
import org.whispersystems.textsecuregcm.util.ua.UnrecognizedUserAgentException;
|
||||
import org.whispersystems.textsecuregcm.util.ua.UserAgent;
|
||||
@@ -23,11 +25,18 @@ public class UserAgentTagUtil {
|
||||
public static final String VERSION_TAG = "clientVersion";
|
||||
public static final String LIBSIGNAL_TAG = "libsignal";
|
||||
|
||||
public static final String SERVER_UA =
|
||||
String.format("Signal-Server/%s (%s)", WhisperServerVersion.getServerVersion(), UUID.randomUUID());
|
||||
|
||||
private UserAgentTagUtil() {
|
||||
}
|
||||
|
||||
public static Tag getPlatformTag(final String userAgentString) {
|
||||
|
||||
if (SERVER_UA.equals(userAgentString)) {
|
||||
return Tag.of(PLATFORM_TAG, "server");
|
||||
}
|
||||
|
||||
UserAgent userAgent = null;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user