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

Admatic: Add headers #3707 #3732

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

przemkaczmarek
Copy link
Collaborator

🔧 Type of changes

  • bid adapter update)

✨ What's the context?

#3707

Comment on lines +60 to +63
requests.add(BidderUtil.defaultRequest(
modifiedBidRequest,
headers(modifiedBidRequest.getDevice()),
resolveEndpoint(impExt), mapper));
Copy link
Collaborator

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));

Comment on lines +88 to +89
HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_FORWARDED_FOR_HEADER, device.getIp());
HttpUtil.addHeaderIfValueIsNotEmpty(headers, HttpUtil.X_FORWARDED_FOR_HEADER, device.getIpv6());
Copy link
Collaborator

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

Comment on lines +123 to +130
.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"));
Copy link
Collaborator

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"))
                 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port PR from PBS-Go: Admatic: Add headers
4 participants