Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/main/java/com/uid2/optout/partner/EndpointConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/test/java/com/uid2/optout/partner/OptOutPartnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand Down Expand Up @@ -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);
Expand Down