Hi,

We're we're using CXF v3.1.3 via JAX-RS and we noticed that
UriInfo.getRequestUri().getHost() is returning 'localhost' instead of
'127.0.0.1' when requests are made to http://127.0.0.1.

The scenario is as follows:
* A users accesses the application via http://127.0.0.1
* The user logs in, creating a session cookie
* The user takes a action on the page that triggers a request to our
ReST API at http://127.0.0.1/rest
* The call in question returns a 303 See Other response with a Location
header of http://localhost/rest
* The user gets a 401 Unauthorized since his session cookie is
associated with 127.0.0.1 and not localhost

Similar behavior occurs when accessing the application via http://0.0.0.0.

I've tracked down the code that does replacement to:
    org.apache.cxf.jaxrs.utils.HttpUtils#toAbsoluteUri(URI u, Message
message)

Is there any way to change this behavior? I would expect the same host
to be returned even when making calls to 127.0.0.1.

Thanks!

-Jesse

Reply via email to