[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit WebRequest.java,1.41,1.42
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2002-07-25 11:19:21
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory usw-pr-cvs1:/tmp/cvs-serv28540/src/com/meterware/httpunit
Modified Files:
WebRequest.java
Log Message:
Rajan Narasimhan: fixed problem with base URLs containing slash in a query string
Index: WebRequest.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebRequest.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- WebRequest.java 20 May 2002 16:00:43 -0000 1.41
+++ WebRequest.java 25 Jul 2002 11:19:18 -0000 1.42
@@ -69,7 +69,13 @@
**/
public URL getURL() throws MalformedURLException {
if (getURLBase() == null || getURLString().indexOf( ':' ) > 0) validateProtocol( getURLString() );
- return new URL( getURLBase(), getURLString() );
+ if (getURLBase() == null || getURLBase().toString().indexOf( "?" ) < 0) {
+ return new URL( getURLBase(), getURLString() );
+ } else {
+ final String urlBaseString = getURLBase().toString();
+ URL newurlbase = new URL( urlBaseString.substring( 0, urlBaseString.indexOf( "?" ) ) );
+ return new URL( newurlbase, getURLString() );
+ }
}
|