CVS Commit: src/xdocs: Added method for setting HttpClient's virtual

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

CVS Commit: src/xdocs: Added method for setting HttpClient's virtual

yourgod
Log Message:
-----------
Added method for setting HttpClient's virtual host

Modified Files:
--------------
    htmlunit/src/xdocs:
        changes.xml
        (http://cvs.sourceforge.net/viewcvs.py/htmlunit/htmlunit/src/xdocs/changes.xml)
    htmlunit/src/java/com/gargoylesoftware/htmlunit:
        HttpWebConnection.java
        (http://cvs.sourceforge.net/viewcvs.py/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java)

Revision Data
-------------
Index: changes.xml
===================================================================
RCS file: /cvsroot/htmlunit/htmlunit/src/xdocs/changes.xml,v
retrieving revision 1.405
retrieving revision 1.406
diff -Lsrc/xdocs/changes.xml -Lsrc/xdocs/changes.xml -u -d -r1.405 -r1.406
--- src/xdocs/changes.xml
+++ src/xdocs/changes.xml
@@ -7,6 +7,9 @@
 
     <body>
         <release version="NextRelease" date="Unknown">
+            <action type="update" dev="yourgod" id="1195509" due-to="dlevine004">
+                Added method for setting HttpClient's virtual host
+            </action>
             <action type="update" dev="mguillem" id="1221161" due-to="Denis N. Antonioli">
              INCOMPATIBLE CHANGE: HtmlElement.getAttributeEntriesIterator now return an iterator
              on HtmlAttr (and not Map.Entry) allowing XPath expressions that return a list of node attributes.
Index: HttpWebConnection.java
===================================================================
RCS file: /cvsroot/htmlunit/htmlunit/src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -Lsrc/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java -Lsrc/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java -u -d -r1.41 -r1.42
--- src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java
+++ src/java/com/gargoylesoftware/htmlunit/HttpWebConnection.java
@@ -89,6 +89,8 @@
 public class HttpWebConnection extends WebConnection {
     private final Map httpClients_ = new HashMap( 9 );
 
+    private String virtualHost_ = null;
+
     /**
      *  Create an instance that will not use a proxy server
      *
@@ -324,6 +326,10 @@
             if( sharedState != null ) {
                 client.setState(sharedState);
             }
+            
+            if (virtualHost_ != null) {
+                client.getParams().setVirtualHost(virtualHost_);
+            }                    
             httpClients_.put( key, client );
         }
         return client;
@@ -338,7 +344,22 @@
     protected final Log getLog() {
         return LogFactory.getLog(getClass());
     }
+    
+    /**
+     * set the virtual host
+     * @param virtualHost The virtualHost to set.
+     */
+    public void setVirtualHost(final String virtualHost) {
+        virtualHost_ = virtualHost;
+    }
 
+    /**
+     * Get the virtual host
+     * @return virtualHost The current virtualHost
+     */
+    public String getVirtualHost() {
+        return virtualHost_;
+    }
 
     /**
      * Return the {@link HttpState} that is being used for a given domain


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop