Open glassfishrobot opened 10 years ago
As far as I can see, UriInfo.getBaseBuilder() does not return a builder that is aware of headers like X-Forwarded-For or X-Forwarded-Proto. It would be great to be able to control this. It seems that the UriBuilder is created is container-specific - for instance, here it is created in a servlet context: https://github.com/jersey/jersey/blob/master/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java#L518 The headers are still the same in any context, though.
The benefit here is that this will prevent developers from having to manually handle this in their resources, making both developing and deploying Jersey applications easier.
[2.7]
Reported by vetler
This issue was imported from java.net JIRA JERSEY-2444
As far as I can see, UriInfo.getBaseBuilder() does not return a builder that is aware of headers like X-Forwarded-For or X-Forwarded-Proto. It would be great to be able to control this. It seems that the UriBuilder is created is container-specific - for instance, here it is created in a servlet context: https://github.com/jersey/jersey/blob/master/containers/jersey-servlet-core/src/main/java/org/glassfish/jersey/servlet/ServletContainer.java#L518 The headers are still the same in any context, though.
The benefit here is that this will prevent developers from having to manually handle this in their resources, making both developing and deploying Jersey applications easier.
Affected Versions
[2.7]