package de.ivu.elect.presentation;

import javax.enterprise.inject.Specializes;

import de.ivu.elect.jee.security.IpHostname;
import de.ivu.elect.jee.security.LoginIpBestimmer;

@Specializes
public class NlLoginIpBestimmer extends LoginIpBestimmer {
  private static final long serialVersionUID = 1L;

  @Override
  protected IpHostname bestimmeIpAdresseAusRequest(boolean schreibeErmittelteAdresseInLog) {
    IpHostname ipHostname = super.bestimmeIpAdresseAusRequest(schreibeErmittelteAdresseInLog);
    // ELECTVAPP-755 X-Forwarded-For ignorieren
    return new IpHostname(ipHostname.getIpRemoteAddr(), ipHostname.getHostnameRemoteAddr(), ipHostname.getIpRemoteAddr(), ipHostname.getHostnameRemoteAddr());
  }
}
