Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-17104

[GSS](7.2.z) UNDERTOW-1569 - HttpServletRequest getLocalName() returns IP instead of hostname

    Details

    • Target Release:
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Use io.undertow.server.handlers.LocalNameResolvingHandler ('resolve-local-name' in expression-filter).
      However, it does have a performance penalty as it does a reverse DNS lookup.

      #CLI command

      /subsystem=undertow/configuration=filter/expression-filter=resolve-local-name-filter:add(expression=resolve-local-name)
      /subsystem=undertow/server=default-server/host=default-host/filter-ref=resolve-local-name-filter:add()
      
      Show
      Use io.undertow.server.handlers.LocalNameResolvingHandler ('resolve-local-name' in expression-filter). However, it does have a performance penalty as it does a reverse DNS lookup. #CLI command /subsystem=undertow/configuration=filter/expression-filter=resolve-local-name-filter:add(expression=resolve-local-name) /subsystem=undertow/server= default -server/host= default -host/filter-ref=resolve-local-name-filter:add()
    • QE Test Coverage:
      +

      Description

      HttpServletRequest getLocalName() returns IP instead of hostname

      If I deploy the below sample code on EAP 7.x

      protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
                System.out.println(request.getLocalName());
                System.out.println(request.getClass());
      }
      

      Output on EAP 7

      17:10:06,950 INFO  [stdout] (default task-1) 10.65.193.93
      17:10:06,950 INFO  [stdout] (default task-1) class io.undertow.servlet.spec.HttpServletRequestImpl
      

      IP address instead of hostname

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tmiyar Teresa Miyar Gil
                  Reporter:
                  rhn-support-shsingh Shailendra Singh
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: