Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/main/java/com/uid2/optout/vertx/OptOutServiceVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ private void handleReplicate(RoutingContext routingContext) {

private void handleQueue(RoutingContext routingContext) {
HttpServerRequest req = routingContext.request();

// skip sqs queueing for validator operators (reference-operator, candidate-operator)
// this avoids triple processing of the same request
String instanceId = req.getHeader(Audit.UID_INSTANCE_ID_HEADER);
if (isValidatorOperatorRequest(instanceId)) {
return;
}

MultiMap params = req.params();
String identityHash = req.getParam(IDENTITY_HASH);
String advertisingId = req.getParam(ADVERTISING_ID);
Expand Down Expand Up @@ -491,6 +499,13 @@ private boolean isGetOrPost(HttpServerRequest req) {
return method == HttpMethod.GET || method == HttpMethod.POST;
}

private boolean isValidatorOperatorRequest(String instanceId) {
if (instanceId == null) {
return false;
}
return instanceId.contains("reference-operator") || instanceId.contains("candidate-operator");
}

private void sendInternalServerError(HttpServerResponse resp, String why) {
if (this.isVerbose && why != null) {
resp.setStatusCode(500);
Expand Down
Loading