eclipse / ecf

ECF project repository
7 stars 14 forks source link

org.eclipse.ecf.provider.filetransfer.httpclientjava.HttpClientFileSystemBrowser seem to not follwo redirects #94

Closed laeubi closed 4 months ago

laeubi commented 7 months ago

I got this exception while loading a repository:

HTTP Server Unknown HTTP Response Code (302):https://download.eclipse.org/modeling/emft/ecoretools/updates/0.10/content.xml
org.eclipse.ecf.filetransfer.BrowseFileTransferException: HttpComponents connection error response code 302.
    at org.eclipse.ecf.provider.filetransfer.httpclientjava.HttpClientFileSystemBrowser.runRequest(HttpClientFileSystemBrowser.java:295)
    at org.eclipse.ecf.provider.filetransfer.browse.AbstractFileSystemBrowser$DirectoryJob.run(AbstractFileSystemBrowser.java:71)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
scottslewis commented 6 months ago

302 is 'temporarily moved' as per https://http.dev/302

Is this still happening for you at this or other urls?

laeubi commented 6 months ago

https://download.eclipse.org/modeling/emft/ecoretools/updates/0.10/content.xml redirects to http://download.eclipse.org/ecoretools/updates/0.10/content.xml (what is not found 404), I'm not sure if ECF should handle it or P2 or ... so I thought it would be good to report it here first.

scottslewis commented 6 months ago

In ECFHttpClientFactory we have:

    HttpClient.Builder builder = HttpClient.newBuilder().followRedirects(Redirect.NORMAL);

My understanding of followRedirects(Redirect.NORMAL) is from here:

https://docs.oracle.com/en%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2F%2F/java.net.http/java/net/http/HttpClient.Redirect.html

For Normal:

Always redirect, except from HTTPS URLs to HTTP URLs.

And it seems like that is the case we have above...i.e. redirecting from https to http url.

Hmm. I don't think changing the redirects (to ALL) should probably be done without some consideration...could be dangerous. I'm not sure if it makes sense to 'fix' this at all in ECF, but I'm open to discussion about remedies if it's not a one-time (server-side?) thing.

scottslewis commented 4 months ago

No response to comment on Apr 3. Closing.