classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Re: HTTPURLConnection redirects to absolute paths


From: Mark Wielaard
Subject: [cp-patches] Re: HTTPURLConnection redirects to absolute paths
Date: Wed, 27 Apr 2005 00:14:17 +0200

Hi Chris,

On Tue, 2005-04-26 at 19:59 +0100, Chris Burdess wrote:
> > Chris, you wrote this code originally following the spec precisely. Do
> > you think this is a good patch/idea?
> 
> If we allow this, should we not also allow any relative URI?

Yes, good point. I quickly looked at what GNU wget does and it has this
comment:

      /* The HTTP specs only allow absolute URLs to appear in
         redirects, but a ton of boneheaded webservers and CGIs out
         there break the rules and use relative URLs, and popular
         browsers are lenient about this, so wget should be too. */

> I don't like this much, but if we are to accept malformed absolute URIs  
> I feel strongly that we should at least report the event as a warning.
> [...]
> Do we have a standard mechanism for reporting warning conditions? Is  
> System.err.println acceptable?

We currently don't. We could use java.util.logging. But that is a but
heavy-weight and not really tested in production. In this particular
case I would not really want to log or give a warning since it seems
such a common practise. (Maybe if we had a system property
gnu.classpath.standards.mode [lenient, warn, strict] that we could
check.)

> I suggest the following patch to implement getErrorStream correctly:
> 
> 2005-04-26  Chris Burdess  <address@hidden>
> 
>          * gnu/java/net/protocol/http/HTTPURLConnection.java: Throw
>          FileNotFoundException and implement getErrorStream on 404.

Thanks. That makes sense.

Could you commit both your patches?
Or I can do it. I would like to get this in before the next snapshot
release tomorrow because it breaks -link support for some people in the
new gjdoc.

Cheers,

Mark

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]