mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 12:46:53 +00:00
Relax validation to allow null reporting tokens.
This commit is contained in:
1 parent
11c93c5f53
commit
95237a22a9
3 files changed
+50
-2
No files matched your search
+1
-1
@@ -639,7 +639,7 @@ public class MessageController {
|
||||
|
||||
// spam report token is optional, but if provided ensure it is valid base64.
|
||||
final Optional<byte[]> maybeSpamReportToken =
|
||||
spamReport != null ? Optional.of(spamReport.token()) : Optional.empty();
|
||||
spamReport != null ? Optional.ofNullable(spamReport.token()) : Optional.empty();
|
||||
|
||||
reportMessageManager.report(sourceNumber, sourceAci, sourcePni, messageGuid, spamReporterUuid, maybeSpamReportToken, userAgent);
|
||||
|
||||
|
||||
@@ -4,9 +4,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import org.whispersystems.textsecuregcm.util.ByteArrayAdapter;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
public record SpamReport(@JsonSerialize(using = ByteArrayAdapter.Serializing.class)
|
||||
@JsonDeserialize(using = ByteArrayAdapter.Deserializing.class)
|
||||
@NotEmpty byte[] token) {}
|
||||
@Nullable byte[] token) {}
|
||||
Reference in new issue
Block a user