Skip to content

Commit 8878dc7

Browse files
authored
Accept special ip headers from gitbook backend (#2446)
1 parent 4336bc2 commit 8878dc7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/gitbook/src/components/Ads/renderAd.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ async function fetchAd({
7575
}: FetchAdOptions): Promise<{ ad: AdItem; ip: string } | null> {
7676
const headersSet = headers();
7777
const ip =
78+
headersSet.get('x-gitbook-ipv4') ??
79+
headersSet.get('x-gitbook-ip') ??
7880
headersSet.get('cf-pseudo-ipv4') ??
7981
headersSet.get('cf-connecting-ip') ??
8082
headersSet.get('x-forwarded-for') ??

0 commit comments

Comments
 (0)