[rfc][icedtea-web] fixfor portalbank.no

Omair Majid omajid at redhat.com
Mon Apr 29 09:15:37 PDT 2013


On 04/29/2013 12:03 PM, Jiri Vanek wrote:
> Hi!
> 
> Today I accidentally stumbled accross another regression in HEAD
> portalbank.no donot implements HTTP requests but provides desired jars
> on GET.
> So I made (findBestUrl) less strict.

The change itself looks okay to me. We are dealing with more-or-less
misconfigured servers here, so I guess we should not be too concerned
about optimizing this case. A fallback to GET seems appropriate.

> * net/sourceforge/jnlp/cache/ResourceTracker : (findBestUrl)
>   now trying GET after each error request of HEAD

Please complete the ChangeLog ;)

> @@ -910,7 +911,7 @@
>  
>                  int responseCode = getUrlResponseCode(url, requestProperties, "HEAD");
>  
> -                if (responseCode == HttpURLConnection.HTTP_NOT_IMPLEMENTED ) {
> +                if (responseCode < 200 || responseCode >= 300) {
>                      System.err.println("NOTE: The server does not appear to support HEAD requests, falling back to GET requests.");

The error message is not very accurate now. We are going through a list
of URLs, searching for the best one. It's likely the URLs will not exist
and so we will probably get 404 errors. The message can be very
misleading in that case.

> +public class HttpUtils {

Could you add a unit test for this?

Cheers,
Omair

-- 
PGP Key: 66484681 (http://pgp.mit.edu/)
Fingerprint = F072 555B 0A17 3957 4E95  0056 F286 F14F 6648 4681



More information about the distro-pkg-dev mailing list