Skip to content

[BUG] Use x-forwarded-for header #8

@AntonioRodriguezRuiz

Description

@AntonioRodriguezRuiz

Description

When accessing the ip of the request in a microservice, we expect the ip of the user, not the API Gateway

Steps to Reproduce

  1. Activate a microservice and the api-gateway
  2. Send a request via the api gateway to the microservice
  3. Note the ip address logged in the microservice is the ip of the api-gateway

Expected Behavior

The IP of the user is forwarded

Actual Behavior

The IP of the user is not forwarded

Proposed fix

Change instances of req.ip to req.headers && req.headers['x-forwarded-for'] || req.ip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions