[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Invalid redirect location

Scott Lewis wrote:
Hi Stefan and Thomas,

Stefan Liebig wrote:
Can you follow the instructions in https://bugs.eclipse.org/bugs/show_bug.cgi?id=262831#c24 and check whether this (still) works? With this ECF should use the HttpUrlConnection. Maybe this works.

This should work as a work around...given that HttpUrlConnection doesn't do the same thing (but it's possible it will...so please report results either way).

The result is that the HttpUrlConnection returns a valid readable InputStream but it is empty for the file in question! So that makes things even worse. I know for sure that the file isn't empty. My Firefox browser has no problem downloading it using the original URL.

Tschüß, Stefan

Thomas Hallgren wrote:
I found a problem in the Apache HttpClient that affects P2 in a bad way. I'm not sure how to deal with it though. Perhaps the ECF team can give some advice.

The problem occurs when trying to read the update site found at http://eclipse-cs.sourceforge.net/update/site.xml. This is an old style update site. Eventually, the UpdateSite.parseFeature attempts to download a feature jar. The server returns a redirect URL and that URL, when normalized, contains a space.

Shouldn't the (normalized) redirect URL not contain a space? I'm not sure what the spec says about client handling of redirect URLs, but I'll take a look. But in any case (whether httpclient is spec-correct or not), we'll see what we can do to fix/workaround.
I'm not sure either. The header field contains a URL that has a space in it. Perhaps the server is doing something wrong. My problem is that I have a customer that wants to replace his old way of aggregating things using the old Update Manager with our new P2 based aggregator. Apparently the old Update Manager doesn't run into this issue so his experience is that by switching to P2, things stop working.

The HttpMethodDirector.processRedirectResponse then makes an attempt to create an URI directly from that response without converting the space to a %20. The result is the exception below.

Is there any way to get around this problem?

I can think of two ways for us to workaround/handle:

1) Modify/patch httpclient (it might be useful to see if this has already been done to httpclient, but given that the 3.x stream isn't being work on any more I sort of doubt it).
2) handle httpclient redirect responses 'manually' within the httpclient provider and do the normalization (%20 insertion) as a work-around.
Not sure how to accomplish #2. Do you mean patch the ECF httpclient provider?

Thomas Hallgren