DiscFilterRequest { public String getLocalAddr() { InetSocketAddress localAddress = localAddress(); if (localAddress.getAddress() == null) return null; return localAddress.getAddress().getHostAddress(); } DiscFilterRequest(ServletOrJdiscHttpRequest parent); abstract String getMethod(); Version getVersion(); URI getUri(); abstract void setUri(URI uri); HttpRequest getParentRequest(); String getRemoteAddr(); void setRemoteAddr(String remoteIpAddress); String getLocalAddr(); Enumeration<String> getAttributeNames(); Object getAttribute(String name); void setAttribute(String name, Object value); boolean containsAttribute(String name); void removeAttribute(String name); abstract String getParameter(String name); abstract Enumeration<String> getParameterNames(); List<String> getParameterNamesAsList(); Enumeration<String> getParameterValues(String name); List<String> getParameterValuesAsList(String name); Map<String,List<String>> getParameterMap(); String getRemoteHost(); int getLocalPort(); int getRemotePort(); Map<String, List<String>> getUntreatedParams(); HeaderFields getUntreatedHeaders(); List<Cookie> getUntreatedCookies(); abstract void addHeader(String name, String value); long getDateHeader(String name); abstract String getHeader(String name); abstract Enumeration<String> getHeaderNames(); abstract List<String> getHeaderNamesAsList(); abstract Enumeration<String> getHeaders(String name); abstract List<String> getHeadersAsList(String name); abstract void removeHeaders(String name); abstract void setHeaders(String name, String value); abstract void setHeaders(String name, List<String> values); int getIntHeader(String name); List<Cookie> getCookies(); void setCookies(List<Cookie> cookies); long getConnectedAt(TimeUnit unit); String getProtocol(); String getQueryString(); String getRemoteUser(); String getRequestURI(); String getRequestedSessionId(); String getScheme(); void setScheme(String scheme, boolean isSecure); String getServerName(); int getServerPort(); abstract Principal getUserPrincipal(); boolean isSecure(); boolean isUserInRole(String role); void setOverrideIsUserInRole(boolean overrideIsUserInRole); void setRemoteHost(String remoteAddr); void setRemoteUser(String remoteUser); abstract void setUserPrincipal(Principal principal); abstract List<X509Certificate> getClientCertificateChain(); void setUserRoles(String[] roles); String getContentType(); String getCharacterEncoding(); void setCharacterEncoding(String encoding); void addCookie(JDiscCookieWrapper cookie); abstract void clearCookies(); JDiscCookieWrapper[] getWrappedCookies(); static boolean isMultipart(DiscFilterRequest request);  }
@Test public void requireThatUnresolvableRemoteAddressesAreSupported() { URI uri = URI.create("http: HttpRequest httpReq = newRequest(uri, HttpRequest.Method.GET, HttpRequest.Version.HTTP_1_1); DiscFilterRequest request = new JdiscFilterRequest(httpReq); Assert.assertNull(request.getLocalAddr()); }