Hi Jesse
On 02/11/15 22:15, Jesse White wrote:
Hi Sergey,
On 11/02/2015 03:59 PM, Sergey Beryozkin wrote:
Does JAX-RS endpoint have an absolute URI address at the initialization time,
if so how does it look like ?
Our JAX-RS endpoint is initialized here:
https://github.com/OpenNMS/opennms/blob/develop/opennms-webapp-rest/src/main/webapp/WEB-INF/applicationContext-cxf-rest-v1.xml#L32
In HttpUtils.toAbsoluteUri there's a line which defaults to 'localhost' if it
its 127.0.0.1 - I don't recall right now
why but I vaguely remember I did it in order to address some issue of its own
related to the use of 127.0.0.1.
Do you see that line being exercised, if yes I can introduce a property,
something like 'preserve.local.ip.address' as
a short term workaround.
Yeah, that's the block I'm hitting. I came across CXF-5068 when trying to
diagnose this, maybe we could reuse the
'disable-address-updates' property?
In CXF 3.1.3 the address updates are disabled by default so it does not
cause any side-effects.
Though if you say using 0.0.0.0 also leads to a 'localhost' being reported then
it is coming out of non-CXF code
(request.getLocalAddress()) - I'm honestly not sure what can be done in case of
'0.0.0.0' to have 127.0.0.1 reported
instead...
0.0.0.0 is replaced with the IP address (and not 'localhost'), but the problem
is still the same since the user's
session cookies don't carry over.
I see...
So let me introduce a property, not sure how to name though, may be
instead of 'preserve.local.ip.address' it should be
'replace.loopback.address.with.localhost' - enabled by default which is
what CXF does now and you'd set it to false in jaxrs:properties.
I'll need to try to recall why the replacement was done, this property
can be disabled by default in time, something that happened to few other
properties too...
Cheers, Sergey
Best,
Jesse