You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Carlos Sierra Andrés <cs...@apache.org> on 2019/12/19 07:48:14 UTC

Fwd: Re: JAX-RS Whiteboard and URI builder

Hello there,

here is some CXF related bug description that was sent to aries.

Bests.

Carlos.


-------- Mensaje reenviado --------
Asunto: 	Re: JAX-RS Whiteboard and URI builder
Fecha: 	Tue, 17 Dec 2019 15:01:28 +0100
De: 	Markus Rathgeb <ma...@gmail.com>
Para: 	Carlos Sierra Andrés <cs...@gmail.com>
CC: 	user@aries.apache.org



Hi,

Carlos, thank you for your reply.

Hm, I don't see any reason why the host part should be replaced at all.

Don't you agree that this will break all "location created" for
127.0.0.1 with respect to CORS handling of the browsers?

I also did not found any specification (but I did not search too long)
that states that 127.0.0.1 needs to be replaced by localhost.

I looked at the sources who is causing the change from 127.0.0.1 to
localhost and found it:

After the line
https://github.com/apache/cxf/blob/cxf-3.2.5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java#L83
has been executed the variable u looks like
http://127.0.0.1:8080/

After that "toAbsoluteUri" of HttpUtils is called.
That's the part of the code that replaces 127.0.0.1 by localhost
https://github.com/apache/cxf/blob/cxf-3.2.5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java#L388-L391

The commit that added that part of code is
https://github.com/apache/cxf/commit/ebc910780b2b9b971a7c1c2e4019bdf9ec35e460#diff-1e4a62a6414e4007d2f5be9f0313c8c0R311-R314

The commit messages refers to CXF-2007 but I do not get the point why
the replacement of IP to "locahost" is done.
https://issues.apache.org/jira/browse/CXF-2007

Do I need to open a Jira ticket for CXF?
Can you ping someone of the CXF guys to read this message?

Best regards,
Markus Rathgeb

Re: Re: JAX-RS Whiteboard and URI builder

Posted by Colm O hEigeartaigh <co...@apache.org>.
Hi Markus,

Yes, create a JIRA and PR. We are just trying to get the TCK tests working
in a Jenkins job first, then we can check to see if anything fails with the
PR applied.

Colm.

On Tue, Jan 7, 2020 at 8:54 PM Markus Rathgeb <ma...@gmail.com> wrote:

> Hi,
>
> any news about it?
> Should I create a JIRA and a PR that removes the IP replacement for
> localhost?
>
> Best regards,
> Markus
>
>
> Am Sa., 21. Dez. 2019 um 12:11 Uhr schrieb Markus Rathgeb <
> maggu2810@gmail.com>:
>
>> Hi all and thank you for your replies.
>>
>> > That JIRA references the TCK. I don't know off-hand if this translation
>> of 127.0.0.1 to localhost would case a TCK test to fail if it was reverted.
>>
>> Okay, it is one thing to pass all TCK tests successfully.
>>
>> But do you not agree that if a code like
>>
>> return
>> Response.created(uriInfo.getBaseUriBuilder().path("foo").path("bar").build()).build();
>>
>> should return a response with status 201 and a location that is using
>> the same host as in the request?
>>
>> Do you consider it is correct to use another location in the response
>> than in the request?
>>
>> What about the cross-origin problems?
>>
>> If you agree that a response for the host 127.0.0.1 should be replied
>> using the host 127.0.0.1, then the test case needs to be fixed.
>> Doesn't it?
>>
>> Best regards,
>> Markus
>>
>

Re: Re: JAX-RS Whiteboard and URI builder

Posted by Markus Rathgeb <ma...@gmail.com>.
Hi,

any news about it?
Should I create a JIRA and a PR that removes the IP replacement for
localhost?

Best regards,
Markus


Am Sa., 21. Dez. 2019 um 12:11 Uhr schrieb Markus Rathgeb <
maggu2810@gmail.com>:

> Hi all and thank you for your replies.
>
> > That JIRA references the TCK. I don't know off-hand if this translation
> of 127.0.0.1 to localhost would case a TCK test to fail if it was reverted.
>
> Okay, it is one thing to pass all TCK tests successfully.
>
> But do you not agree that if a code like
>
> return
> Response.created(uriInfo.getBaseUriBuilder().path("foo").path("bar").build()).build();
>
> should return a response with status 201 and a location that is using
> the same host as in the request?
>
> Do you consider it is correct to use another location in the response
> than in the request?
>
> What about the cross-origin problems?
>
> If you agree that a response for the host 127.0.0.1 should be replied
> using the host 127.0.0.1, then the test case needs to be fixed.
> Doesn't it?
>
> Best regards,
> Markus
>

Re: Re: JAX-RS Whiteboard and URI builder

Posted by Markus Rathgeb <ma...@gmail.com>.
Hi all and thank you for your replies.

> That JIRA references the TCK. I don't know off-hand if this translation of 127.0.0.1 to localhost would case a TCK test to fail if it was reverted.

Okay, it is one thing to pass all TCK tests successfully.

But do you not agree that if a code like

return Response.created(uriInfo.getBaseUriBuilder().path("foo").path("bar").build()).build();

should return a response with status 201 and a location that is using
the same host as in the request?

Do you consider it is correct to use another location in the response
than in the request?

What about the cross-origin problems?

If you agree that a response for the host 127.0.0.1 should be replied
using the host 127.0.0.1, then the test case needs to be fixed.
Doesn't it?

Best regards,
Markus

Re: Re: JAX-RS Whiteboard and URI builder

Posted by Andrey Redko <dr...@gmail.com>.
Hey Colm,

Unfortunately I didn't succeed yet, prioritizing issues over TCK runs, will
try to resume work shortly.

Best Regards,
    Andriy Redko

On Fri, Dec 20, 2019, 7:56 AM Colm O hEigeartaigh <co...@apache.org>
wrote:

> The git commit referenced the wrong JIRA - it should have been
> https://issues.apache.org/jira/browse/CXF-5007
>
> That JIRA references the TCK. I don't know off-hand if this translation of
> 127.0.0.1 to localhost would case a TCK test to fail if it was reverted.
>
> @Andriy Redko <dr...@gmail.com> did you ever manage to get the TCK tests
> working?
>
> Colm.
>
> On Thu, Dec 19, 2019 at 7:48 AM Carlos Sierra Andrés <cs...@apache.org>
> wrote:
>
>> Hello there,
>>
>> here is some CXF related bug description that was sent to aries.
>>
>> Bests.
>>
>> Carlos.
>>
>>
>> -------- Mensaje reenviado --------
>> Asunto:         Re: JAX-RS Whiteboard and URI builder
>> Fecha:  Tue, 17 Dec 2019 15:01:28 +0100
>> De:     Markus Rathgeb <ma...@gmail.com>
>> Para:   Carlos Sierra Andrés <cs...@gmail.com>
>> CC:     user@aries.apache.org
>>
>>
>>
>> Hi,
>>
>> Carlos, thank you for your reply.
>>
>> Hm, I don't see any reason why the host part should be replaced at all.
>>
>> Don't you agree that this will break all "location created" for
>> 127.0.0.1 with respect to CORS handling of the browsers?
>>
>> I also did not found any specification (but I did not search too long)
>> that states that 127.0.0.1 needs to be replaced by localhost.
>>
>> I looked at the sources who is causing the change from 127.0.0.1 to
>> localhost and found it:
>>
>> After the line
>>
>> https://github.com/apache/cxf/blob/cxf-3.2.5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java#L83
>> has been executed the variable u looks like
>> http://127.0.0.1:8080/
>>
>> After that "toAbsoluteUri" of HttpUtils is called.
>> That's the part of the code that replaces 127.0.0.1 by localhost
>>
>> https://github.com/apache/cxf/blob/cxf-3.2.5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java#L388-L391
>>
>> The commit that added that part of code is
>>
>> https://github.com/apache/cxf/commit/ebc910780b2b9b971a7c1c2e4019bdf9ec35e460#diff-1e4a62a6414e4007d2f5be9f0313c8c0R311-R314
>>
>> The commit messages refers to CXF-2007 but I do not get the point why
>> the replacement of IP to "locahost" is done.
>> https://issues.apache.org/jira/browse/CXF-2007
>>
>> Do I need to open a Jira ticket for CXF?
>> Can you ping someone of the CXF guys to read this message?
>>
>> Best regards,
>> Markus Rathgeb
>>
>

Re: Re: JAX-RS Whiteboard and URI builder

Posted by Colm O hEigeartaigh <co...@apache.org>.
The git commit referenced the wrong JIRA - it should have been
https://issues.apache.org/jira/browse/CXF-5007

That JIRA references the TCK. I don't know off-hand if this translation of
127.0.0.1 to localhost would case a TCK test to fail if it was reverted.

@Andriy Redko <dr...@gmail.com> did you ever manage to get the TCK tests
working?

Colm.

On Thu, Dec 19, 2019 at 7:48 AM Carlos Sierra Andrés <cs...@apache.org>
wrote:

> Hello there,
>
> here is some CXF related bug description that was sent to aries.
>
> Bests.
>
> Carlos.
>
>
> -------- Mensaje reenviado --------
> Asunto:         Re: JAX-RS Whiteboard and URI builder
> Fecha:  Tue, 17 Dec 2019 15:01:28 +0100
> De:     Markus Rathgeb <ma...@gmail.com>
> Para:   Carlos Sierra Andrés <cs...@gmail.com>
> CC:     user@aries.apache.org
>
>
>
> Hi,
>
> Carlos, thank you for your reply.
>
> Hm, I don't see any reason why the host part should be replaced at all.
>
> Don't you agree that this will break all "location created" for
> 127.0.0.1 with respect to CORS handling of the browsers?
>
> I also did not found any specification (but I did not search too long)
> that states that 127.0.0.1 needs to be replaced by localhost.
>
> I looked at the sources who is causing the change from 127.0.0.1 to
> localhost and found it:
>
> After the line
>
> https://github.com/apache/cxf/blob/cxf-3.2.5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java#L83
> has been executed the variable u looks like
> http://127.0.0.1:8080/
>
> After that "toAbsoluteUri" of HttpUtils is called.
> That's the part of the code that replaces 127.0.0.1 by localhost
>
> https://github.com/apache/cxf/blob/cxf-3.2.5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java#L388-L391
>
> The commit that added that part of code is
>
> https://github.com/apache/cxf/commit/ebc910780b2b9b971a7c1c2e4019bdf9ec35e460#diff-1e4a62a6414e4007d2f5be9f0313c8c0R311-R314
>
> The commit messages refers to CXF-2007 but I do not get the point why
> the replacement of IP to "locahost" is done.
> https://issues.apache.org/jira/browse/CXF-2007
>
> Do I need to open a Jira ticket for CXF?
> Can you ping someone of the CXF guys to read this message?
>
> Best regards,
> Markus Rathgeb
>