Skip to content

Commit

Permalink
DO-1563: Add custom header to forward user-agent header value to the …
Browse files Browse the repository at this point in the history
…Prerender origin
  • Loading branch information
Chris Park committed Oct 31, 2023
1 parent 530d2a8 commit 5c29d02
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/prerender-proxy/lib/handlers/prerender-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export const handler = async (
request.headers["x-prerender-host"] = [
{ key: "X-Prerender-Host", value: request.headers.host[0].value },
];

// Custom header to be forwarded to Prerender service for better logging
request.headers["x-prerender-user-agent"] = [
{
key: "x-prerender-user-agent",
value: request.headers["user-agent"][0].value,
},
];
}
}

Expand Down

0 comments on commit 5c29d02

Please sign in to comment.