Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
2.7.5
-
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.