Reject traffic without logging exceptions

This commit is contained in:
Moxie Marlinspike 2021-01-15 13:14:44 -08:00 committed by Jon Chambers
parent b64b27e5ea
commit b100b3c36b
1 changed files with 2 additions and 3 deletions

View File

@ -110,13 +110,14 @@ public class MessageController {
@PUT @PUT
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public SendMessageResponse sendMessage(@Auth Optional<Account> source, public Response sendMessage(@Auth Optional<Account> source,
@HeaderParam(OptionalAccess.UNIDENTIFIED) Optional<Anonymous> accessKey, @HeaderParam(OptionalAccess.UNIDENTIFIED) Optional<Anonymous> accessKey,
@HeaderParam("User-Agent") String userAgent, @HeaderParam("User-Agent") String userAgent,
@PathParam("destination") AmbiguousIdentifier destinationName, @PathParam("destination") AmbiguousIdentifier destinationName,
@Valid IncomingMessageList messages) @Valid IncomingMessageList messages)
throws RateLimitExceededException throws RateLimitExceededException
{ {
return Response.status(503).build();
/* if (!source.isPresent() && !accessKey.isPresent()) { /* if (!source.isPresent() && !accessKey.isPresent()) {
throw new WebApplicationException(Response.Status.UNAUTHORIZED); throw new WebApplicationException(Response.Status.UNAUTHORIZED);
} }
@ -187,8 +188,6 @@ public class MessageController {
.entity(new StaleDevices(e.getStaleDevices())) .entity(new StaleDevices(e.getStaleDevices()))
.build()); .build());
} */ } */
throw new WebApplicationException(Response.status(503).build());
} }
@Timed @Timed