Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.uid2</groupId>
<artifactId>uid2-optout</artifactId>
<version>4.5.0</version>
<version>4.5.1-alpha-136-SNAPSHOT</version>
<name>uid2-optout</name>
<url>https://github.com/IABTechLab/uid2-optout</url>

Expand Down
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 tripple 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