Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Rubicon fix regs population #2123

Merged
merged 1 commit into from
Jan 17, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ private static Regs makeRegs(Regs regs) {
final Integer gdpr = regs.getGdpr();
final String usPrivacy = regs.getUsPrivacy();
if (gdpr == null && usPrivacy == null) {
return null;
return regs;
}

final ExtRegs extRegs = copyProperties(regs.getExt(), ExtRegs.of(gdpr, usPrivacy));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,25 @@ public void makeHttpRequestsShouldFillRegsIfRegsAndGdprArePresent() {
.containsOnly(Regs.builder().ext(ExtRegs.of(50, "us")).build());
}

@Test
public void makeHttpRequestsShouldNotModifyRegs() {
// given
final BidRequest bidRequest = givenBidRequest(
builder -> builder.regs(Regs.builder().coppa(1).build()),
builder -> builder.video(Video.builder().build()),
identity());

// when
final Result<List<HttpRequest<BidRequest>>> result = rubiconBidder.makeHttpRequests(bidRequest);

// then
assertThat(result.getErrors()).isEmpty();
assertThat(result.getValue()).hasSize(1).doesNotContainNull()
.extracting(httpRequest -> mapper.readValue(httpRequest.getBody(), BidRequest.class))
.extracting(BidRequest::getRegs).doesNotContainNull()
.containsOnly(Regs.builder().coppa(1).build());
}

@Test
public void makeHttpRequestsShouldFillDeviceExtIfDevicePresent() throws JsonProcessingException {
// given
Expand Down