Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5068

Getting a cached base url from UriInfo object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.7.5
    • Invalid
    • None
    • None
    • Unknown

    Description

      We are using UriInfo.getBaseUriBuilder() to get the base URI of the request. It looks like that the base uri or at least the host name is cached which shouldn't be.

      Test Case:

      Perform following request sequence:

      1) http://localhost/endpoint -> base uri returns localhost
      2) http://127.0.0.1/endpoint -> base uri returns localhost

      Restart server and execute in reverse order then the base uri always returns 127.0.0.1 as host.

      Assumption: host name is cached in the 2nd request.

      This is an issue for servers supporting alias host names.

      Workaround: construct base url from HttpServletRequest.

      Attachments

        Issue Links

          Activity

            People

              sergey_beryozkin Sergey Beryozkin
              klevenzs Stephan Klevenz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: