Details
Description
In the early incubating phase the URLInfo were retrieved via a full http GET request. In the latest codebase this has been changed to a faster HEAD request to optimize performance. For most network scenarios this is no problem. But in our company we are going through at least 2 proxies to access the internet. We have no control over the settings/configurations of all of these proxies. Using a full http GET request in the getURLInfo() method the retrieve is working in this scenario without any problems; but using only a HEAD request the retrieve failed with an exception "Server access Error: Unexpected end of file from server ".
So my suggestion is to add a configuration option to ivy which (if set) causes to fall back to the slower but working GET request in the method.
I hope that I classified the issue correctly - for most users it might not be as important as it is for ourselves.
The entry in ivy-user mailing list concerning this issue: http://www.nabble.com/.bundle-extension-in-ivy-retrieve...-im-so-confused-td18562574.html
So here come my proposed patches for the involved classes (for both cases - when using the commons-httpclient or the basic handler).
I've altered the following classes: AbstractURLHandler, BasicURLHandler, HttpClientHandler
I've not changed the invocation/creation of the handler - it is created in URLHandlerRegistry#getHttp() via org.apache.ivy.Main#configureURLHandler(...) or org.apache.ivy.ant.IvyAntSettings#configureURLHandler(). Currently the getHttp() method takes no parameter - maybe this should be changed passing the introduced flag as an int. Or an alternative approach should be used to pass the new ivy-config parameter through to the getURLInfo() method. Hope you will manage the rest of it the way you handle such cases overall in the codebase.