8000 [Bridge] WebProcessor does not add the correct IP behind a loadbalancer. · Issue #17905 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Bridge] WebProcessor does not add the correct IP behind a loadbalancer. #17905
Closed
@magnetik

Description

@magnetik

Hi,

In the \Symfony\Bridge\Monolog\Processor\WebProcessor class, the content of the server attributes of the request is copied info the serverData property.

When processing the request, \Monolog\Processor\WebProcessor computes some fields from the serverData (which is basically $_SERVER), such as REMOTE_ADDR for the ip field.
Sadly it is not matching the "correct" IP from Request->getClientIp() for instance.
It's a problem when symfony is used behind a load balancer

An easy fix would be to override the REMOTE_ADDR to Request->getClientIp() in the serverData. Not sure if clear but I can do a PR if needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0