From: Dale A. <dal...@us...> - 2005-09-26 20:08:46
|
Update of /cvsroot/ant-contrib/ant-contrib/src/net/sf/antcontrib/net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9040 Modified Files: PostTask.java Log Message: Fixed problem with cookie handling where a cookie with a value containing "=" was improperly getting split into multiple name/value pairs. This had the effect of trimming the trailing "=" from a cookie with a base 64 encoded value, so the coookie value could no longer be decoded. Index: PostTask.java =================================================================== RCS file: /cvsroot/ant-contrib/ant-contrib/src/net/sf/antcontrib/net/PostTask.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PostTask.java 23 Sep 2005 19:51:09 -0000 1.10 --- PostTask.java 26 Sep 2005 20:08:38 -0000 1.11 *************** *** 635,650 **** public Cookie( String raw ) { String[] args = raw.split( "[;]" ); ! for ( int i = 0; i < args.length; i++ ) { ! String part = args[ i ]; ! String[] parts = part.split( "[=]" ); ! parts[ 0 ] = parts[ 0 ].trim(); ! if ( i == 0 ) { ! name = parts[ 0 ]; ! value = parts[ 1 ]; ! } ! else if ( parts[ 0 ].equalsIgnoreCase( "Path" ) ) ! path = parts[ 1 ]; ! else if ( parts[ 0 ].equalsIgnoreCase( "Domain" ) ) ! domain = parts[ 1 ]; } if (name == null) --- 635,653 ---- public Cookie( String raw ) { String[] args = raw.split( "[;]" ); ! for ( int i = 0; i < args.length; i++ ) { ! String part = args[ i ]; ! int eq_index = part.indexOf("="); ! if (eq_index == -1) ! continue; ! String first_part = part.substring(0, eq_index).trim(); ! String second_part = part.substring(eq_index + 1); ! if ( i == 0 ) { ! name = first_part; ! value = second_part; ! } ! else if ( first_part.equalsIgnoreCase( "Path" ) ) ! path = second_part; ! else if ( first_part.equalsIgnoreCase( "Domain" ) ) ! domain = second_part; } if (name == null) *************** *** 703,707 **** /** ! * @param the domain of the cookie */ public void setDomain( String domain ) { --- 706,710 ---- /** ! * @param domain the domain of the cookie */ public void setDomain( String domain ) { |