Minor cleanup of report spam endpoint (#1979)

This commit is contained in:
ameya-signal
2024-03-21 10:41:25 -07:00
committed by GitHub
parent e7d1eadf8e
commit 7f0f045f29
3 changed files with 5 additions and 7 deletions

View File

@@ -752,7 +752,7 @@ public class MessageController {
@ReadOnly @Auth AuthenticatedAccount auth,
@PathParam("source") String source,
@PathParam("messageGuid") UUID messageGuid,
@Nullable @Valid SpamReport spamReport,
@Nullable SpamReport spamReport,
@HeaderParam(HttpHeaders.USER_AGENT) String userAgent
) {
@@ -786,7 +786,7 @@ public class MessageController {
UUID spamReporterUuid = auth.getAccount().getUuid();
// spam report token is optional, but if provided ensure it is valid base64 and non-empty.
// spam report token is optional, but if provided ensure it is non-empty.
final Optional<byte[]> maybeSpamReportToken =
Optional.ofNullable(spamReport)
.flatMap(r -> Optional.ofNullable(r.token()))