RequestParser { int port(int requestPort, String xForwardedPort) { if (xForwardedPort != null) { int index = xForwardedPort.indexOf(','); if (index > 0) return Integer.parseInt(xForwardedPort.substring(0, index)); else return Integer.parseInt(xForwardedPort); } return requestPort; }  void parse(RequestImpl request, HttpServerExchange exchange, ActionLog actionLog); final ClientIPParser clientIPParser; public boolean logSiteHeaders; }
@Test void port() { assertThat(parser.port(80, null)).isEqualTo(80); assertThat(parser.port(80, "443")).isEqualTo(443); assertThat(parser.port(80, "443, 80")).isEqualTo(443); }