Replies: 1 comment
-
|
Zero opinions? Really? 😆 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For many use cases a JAX-RS applications needs to know the URI actually used by the caller. Just one example is the
Locationheader to be returned with a201 Createdresponse. Unfortunately, Uri.getRequestUri() does not contain the actual URI used by the caller, but it in fact contains the base URI provided when bootstrapping Jersey. This is problematic in case where (a) bootstrapping happened using "localhost" but caller is not on the same host (soLocationwould containlocalhost, hence resolves to the caller's machine, or (b) the server has additional aliases for external callers, so returnsLocationwith the canonical (possible "internal") host name while the caller expects an alias - in which case the caller cannot reach the server!IMHO this is a bug. getRequestUri() should always return the host found in the
Hostheader, but should never returnlocalhost.WDYT?
Beta Was this translation helpful? Give feedback.
All reactions