-
Notifications
You must be signed in to change notification settings - Fork 190
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
Admatic: Add headers #3707 #3732
base: master
Are you sure you want to change the base?
Conversation
requests.add(BidderUtil.defaultRequest( | ||
modifiedBidRequest, | ||
headers(modifiedBidRequest.getDevice()), | ||
resolveEndpoint(impExt), mapper)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests.add(BidderUtil.defaultRequest(
modifiedBidRequest,
headers(modifiedBidRequest.getDevice()),
resolveEndpoint(impExt),
mapper));
HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_FORWARDED_FOR_HEADER, device.getIp()); | ||
HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_FORWARDED_FOR_HEADER, device.getIpv6()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong sequence. IpV6 must be first so it will be overwritten by ip if both are present
.satisfies(headers -> assertThat(headers.get(CONTENT_TYPE_HEADER)) | ||
.isEqualTo(APPLICATION_JSON_CONTENT_TYPE)) | ||
.satisfies(headers -> assertThat(headers.get(ACCEPT_HEADER)) | ||
.isEqualTo(APPLICATION_JSON_VALUE)) | ||
.satisfies(headers -> assertThat(headers.get(USER_AGENT_HEADER)) | ||
.isEqualTo("ua")) | ||
.satisfies(headers -> assertThat(headers.get(X_FORWARDED_FOR_HEADER)) | ||
.isEqualTo("ip")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.satisfies(headers -> {
assertThat(headers.get(CONTENT_TYPE_HEADER)).isEqualTo(APPLICATION_JSON_CONTENT_TYPE))
assertThat(headers.get(ACCEPT_HEADER)).isEqualTo(APPLICATION_JSON_VALUE))
assertThat(headers.get(USER_AGENT_HEADER)).isEqualTo("ua"))
assertThat(headers.get(X_FORWARDED_FOR_HEADER)).isEqualTo("ip"))
});
🔧 Type of changes
✨ What's the context?
#3707