diff --git a/src/main/java/com/uid2/optout/partner/EndpointConfig.java b/src/main/java/com/uid2/optout/partner/EndpointConfig.java index 89fdd37..00f9955 100644 --- a/src/main/java/com/uid2/optout/partner/EndpointConfig.java +++ b/src/main/java/com/uid2/optout/partner/EndpointConfig.java @@ -45,8 +45,9 @@ public static EndpointConfig fromJsonObject(JsonObject obj) throws JsonProcessin public static EndpointConfig fromJsonString(String str) throws JsonProcessingException, InvalidPropertiesFormatException { EndpointConfig ret = EndpointConfig.mapper.readValue(str, EndpointConfig.class); - // normalize name and URL, query_params and additional_headers are spared) - ret.url = ret.url.toLowerCase(); + // normalize name, query_params and additional_headers are spared) + // UID2-3697 do not normalize/lower case ret.url as it doesn't just contain the top level domain/hostname + // but also optional path which is case sensitive ret.name = ret.name.toLowerCase(); // validate query_params, param should be in the format of key=val diff --git a/src/test/java/com/uid2/optout/partner/OptOutPartnerTest.java b/src/test/java/com/uid2/optout/partner/OptOutPartnerTest.java index c80cf89..0b5c724 100644 --- a/src/test/java/com/uid2/optout/partner/OptOutPartnerTest.java +++ b/src/test/java/com/uid2/optout/partner/OptOutPartnerTest.java @@ -38,7 +38,8 @@ public void tearDown(TestContext ctx) { public void internalSite_expectSuccess(TestContext ctx) throws JsonProcessingException, InvalidPropertiesFormatException { String partnerConfigStr = "{" + " \"name\": \"ttd\",\n" + - " \"url\": \"http://localhost:18083/uid2optout\",\n" + + //UID2-3697 intentionally added some upper cases to make sure the url is the same as what's provided by DSP originally + " \"url\": \"http://localhost:18083/AdServer/uid2optout\",\n" + " \"method\": \"GET\",\n" + " \"query_params\": [\n" + " \"uid2=${ADVERTISING_ID}\",\n" + @@ -93,7 +94,7 @@ private void testConfig_expectSuccess(TestContext ctx, String partnerConfigStr, if (createInternalTestServer) { Async async = ctx.async(); HttpServer server = this.createTestServer(ctx, req -> { - ctx.assertEquals("/uid2optout", req.path()); + ctx.assertEquals("/AdServer/uid2optout", req.path()); String uid2Expected = OptOutEntry.idHashB64FromLong(1234); String uid2 = req.getParam(OptOutPartnerTest.PARAM_UID2);