-
Bug
-
Resolution: Fixed
-
Major
-
windows
The code in hudson.model.UpdateCenter$UpdateCenterConfiguration.checkUpdateCentermakes blind assumptions about the protocol and validity of an update center URL.
Blindly appending a string to a URL does not necessarily a valid URL for connection checking make.
For example the URL could be a file based url
and the URL file://c:/some/path/to/updates.json will become file://c:/some/path/to/updates.json?uctest
Later on the URL is used in hudson.model.UpdateCenter.UpdateCenterConfiguration.test connection(URL) - and if it is not a http URL it will try Util.copyStreamAndClose(connection.getInputStream(),new NullOutputStream()); which on windows will fail as it will try and open c:\some\path\to\updates.json?uctest which will fail with an exception - and then fail the update check.
public void checkUpdateCenter(ConnectionCheckJob job, String updateCenterUrl) throws IOException { testConnection(new URL(updateCenterUrl + "?uctest")); }