playframework / playframework/play1

Request.remoteAddress returns multiple IP's where a client has used a proxy

Open
#1,337 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Java
Stars
1.6k
Forks
671
Avg merge
12d 15h
Merged PRs (30d)
1

Description

Play Version

1.5.3

Operating System (Ubuntu 15.10 / MacOS 10.10 / Windows 10)

Ubuntu

JDK (Oracle 1.8.0_72, OpenJDK 1.8.x, Azul Zing)

JDK 8

Expected Behavior

Request.remoteAddress should only return one IP address of the client's IP.

Actual Behavior

In cases where a request has made multiple 'hops' through proxies, and a x-forwarded-for header has been populated with the client IP plus the proxy addresses as per the specification (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For) e.g X-Forwarded-For: , , then calling Request.remoteAddress actually returns a comma separated list rather than a single IP address.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Request.remoteAddress entry point and reviewing how the X-Forwarded-For header is handled for multiple proxy hops. The change is complete when remoteAddress returns one client IP instead of a comma-separated list; no specific file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.