Skip to content

Commit

Permalink
revert tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 11, 2024
1 parent 8447313 commit 0ae3a42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/astro/src/core/app/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ export class NodeApp extends App {
// Get the IP of end client behind the proxy.
// @example "1.1.1.1,8.8.8.8" => "1.1.1.1"
const forwardedClientIp = getFirstForwardedValue(req.headers['x-forwarded-for']);
if (forwardedClientIp) {
Reflect.set(request, clientAddressSymbol, forwardedClientIp);
const clientIp = forwardedClientIp || req.socket?.remoteAddress;
if (clientIp) {
Reflect.set(request, clientAddressSymbol, clientIp);
}

return request;
Expand Down

0 comments on commit 0ae3a42

Please sign in to comment.