Skip to content

Commit 5f5531d

Browse files
committed
fix posthog
1 parent edfddeb commit 5f5531d

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

apps/sim/app/ingest/[[...path]]/route.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,12 @@ function buildTargetUrl(pathname: string, search: string): { url: string; hostna
2121

2222
/**
2323
* Builds forwarding headers for the PostHog request.
24-
* Sets the Host header, forwards client IP for geolocation,
25-
* and strips cookies/connection headers that shouldn't be forwarded.
24+
* Sets the Host header and strips cookies/connection headers
25+
* that shouldn't be forwarded.
2626
*/
2727
function buildHeaders(request: NextRequest, hostname: string): Headers {
2828
const headers = new Headers(request.headers)
2929
headers.set('host', hostname)
30-
31-
const forwardedFor = request.headers.get('x-forwarded-for')
32-
if (forwardedFor) {
33-
headers.set('x-forwarded-for', forwardedFor)
34-
}
35-
3630
headers.delete('cookie')
3731
headers.delete('connection')
3832

@@ -54,6 +48,7 @@ async function handler(request: NextRequest) {
5448

5549
const responseHeaders = new Headers(response.headers)
5650
responseHeaders.delete('content-encoding')
51+
responseHeaders.delete('content-length')
5752
responseHeaders.delete('transfer-encoding')
5853

5954
return new NextResponse(response.body, {

0 commit comments

Comments
 (0)