Login | Register
My pages Projects Community openCollabNet

Discussions > users > Bug in PostTask

antelope
Discussion topic

Hide all messages in topic

All messages in topic

Bug in PostTask

Author Allan Jones <allan dot jones at gmail dot com>
Full name Allan Jones <allan dot jones at gmail dot com>
Date 2007-04-04 09:58:19 PDT
Message Hello guys,

I'm a user of antelope ant tasks and I found a bug in PostTask,
exactly in Cookie inner class:

        /**
         * @return a Cookie formatted as a Cookie Version 1 string.
The returned
         * string is suitable for including with an http request.
         */
        public String toString() {
            StringBuffer sb = new StringBuffer();
            sb.append( name ).append( "=" ).append( value ).append( ";" );
            if ( domain != null )
                sb.append( "Domain=" ).append( domain ).append( ";" );
            if ( path != null )
                sb.append( "Path=" ).append( path ).append( ";" );
            sb.append( "Version=\"1\";" );
            return sb.toString();
        }

should be

        /**
         * @return a Cookie formatted as a Cookie Version 1 string.
The returned
         * string is suitable for including with an http request.
         */
        public String toString() {
            StringBuffer sb = new StringBuffer();
            sb.append( name ).append( "=" ).append( value ).append( ";" );
            if ( domain != null )
                sb.append( "$Domain=" ).append( domain ).append( ";" );
            if ( path != null )
                sb.append( "$Path=" ).append( path ).append( ";" );
            sb.append( "$Version=\"1\";" );
            return sb.toString();
        }

A $ must precede Domain, Path and Version, or an HTTP 400 is received.



And I'm asking a new feature: followredirects attribute in post task:

   private boolean followRedirects;

   public boolean isFollowredirects() {
      return followRedirects;
   }

   public void setFollowredirects(boolean followRedirects) {
      this.followRedirects = followRedirects;
   }
...
connection = to.openConnection();
connection.setDoInput( true );
connection.setDoOutput( true );
connection.setUseCaches( false );
connection.setInstan​ceFollowRedirects(fo​llowRedirects);
...


Thanks
--
Allan Jones
https://genesis.dev.java.net/
Summa Technologies do Brasil Ltda.
Messages per page: