[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit DNSListener.java,1.1,1.2 WebConversation.
Brought to you by:
russgold
|
From: Russell G. <rus...@us...> - 2003-03-20 15:22:00
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit
In directory sc8-pr-cvs1:/tmp/cvs-serv28039/src/com/meterware/httpunit
Modified Files:
DNSListener.java WebConversation.java
Log Message:
DNS lookup cleanup
Index: DNSListener.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/DNSListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DNSListener.java 19 Mar 2003 19:08:58 -0000 1.1
+++ DNSListener.java 20 Mar 2003 15:21:57 -0000 1.2
@@ -10,6 +10,8 @@
/**
* Returns the IP address as a string for the specified host name.
+ * Note: no validation is done to verify that the returned value is an actual IP address or
+ * that the passed host name was not an IP address.
**/
String getIpAddress( String hostName );
Index: WebConversation.java
===================================================================
RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/WebConversation.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- WebConversation.java 19 Mar 2003 19:43:46 -0000 1.30
+++ WebConversation.java 20 Mar 2003 15:21:57 -0000 1.31
@@ -67,7 +67,9 @@
String hostName = request.getURL().getHost();
setHeaderField( "Host", hostName + ':' + request.getURL().getPort() );
- return new URL( request.getURL().getProtocol(), dnsListener.getIpAddress( hostName ), request.getURL().getPort(), request.getURL().getFile() );
+ String actualHost = dnsListener.getIpAddress( hostName );
+ if (HttpUnitOptions.isLoggingHttpHeaders()) System.out.println( "Rerouting request to :: " + actualHost );
+ return new URL( request.getURL().getProtocol(), actualHost, request.getURL().getPort(), request.getURL().getFile() );
}
|