Improve logging in IngestRestService to log real client IP if behind a proxy

Description

IngestRestService logs the client IP of a CA ingesting:

2013-09-09 14:05:09 INFO (IngestRestService:739) - Received new request from 127.0.0.1 to ingest a zipped mediapackage

but as shown above if the CA is behind a proxy, then you get the IP of the proxy which is less helpful.

Similar to MH-8616, we should log the client IP behind the proxy through the X-Forwarded-For header, e.g. code example from UserTrackingRestService.java:

//MH-8616 the connection might be via a proxy
String clientIP = request.getHeader("X-FORWARDED-FOR");

if (clientIP == null) {
clientIP = request.getRemoteAddr();
}

Activity

Show:
Tobias Wunden
October 21, 2013, 8:45 PM

2013-10-21 21:41:00 INFO (IngestRestService:698) - Received new request from 10.99.1.23 to ingest a zipped mediapackage

Greg Logan
October 24, 2013, 7:15 PM

Merged into 1.4.x

Fixed and reviewed

Assignee

Tobias Wunden

Reporter

Stephen Marquard

Criticality

None

Tags (folksonomy)

None

Components

Fix versions

Affects versions

Configure