[jboss-jira] [JBoss JIRA] (ELY-1040) Elytron, incorrect IPv6 address resolution

Martin Choma (JIRA) issues at jboss.org
Wed Mar 29 06:39:00 EDT 2017


Martin Choma created ELY-1040:
---------------------------------

             Summary: Elytron, incorrect IPv6 address resolution 
                 Key: ELY-1040
                 URL: https://issues.jboss.org/browse/ELY-1040
             Project: WildFly Elytron
          Issue Type: Bug
            Reporter: Martin Choma
            Assignee: Darran Lofthouse
            Priority: Critical


There is code in Elytron 
{code:java|title=SetMechanismInformationMechanismFactory.java}
@Override
            public void evaluateRequest(HttpServerRequest request) throws HttpAuthenticationException {
                String host = request.getFirstRequestHeaderValue(HOST);
                String resolvedHostName = null;
                if (host != null) {
                  if (host.startsWith("[")) {
                      int close = host.indexOf(']');
                      if (close > 0) {
                          resolvedHostName = host.substring(0, close);
                      }
                  }
{code}

I assume intention of this code is to get from e.g. "[::1]:8080" just "[::1]", but now it gets only "[::1". To achieve this my assumption, there should be rather

{code}
resolvedHostName = host.substring(0, close + 1);
{code}




--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list