hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r712727 - /httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
Date Mon, 10 Nov 2008 19:38:43 GMT
Author: olegk
Date: Mon Nov 10 11:38:43 2008
New Revision: 712727

URL: http://svn.apache.org/viewvc?rev=712727&view=rev
Log:
Removed IgnoreConnectMethod private class, which is no longer needed; updated User-Agent string

Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java?rev=712727&r1=712726&r2=712727&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
(original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
Mon Nov 10 11:38:43 2008
@@ -31,12 +31,7 @@
 
 package org.apache.http.impl.client;
 
-import java.io.IOException;
-
 import org.apache.http.ConnectionReuseStrategy;
-import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpVersion;
 import org.apache.http.auth.AuthSchemeRegistry;
 import org.apache.http.client.AuthenticationHandler;
@@ -145,7 +140,7 @@
         final String release = (vi != null) ?
             vi.getRelease() : VersionInfo.UNAVAILABLE;
         HttpProtocolParams.setUserAgent(params, 
-                "Apache-HttpClient/" + release + " (java 1.4)");
+                "Apache-HttpClient/" + release + " (java 1.5)");
 
         return params;
     }
@@ -271,9 +266,9 @@
         httpproc.addInterceptor(new RequestDefaultHeaders());
         // Required protocol interceptors
         httpproc.addInterceptor(new RequestContent());
-        httpproc.addInterceptor(new IgnoreConnectMethod(new RequestTargetHost()));
+        httpproc.addInterceptor(new RequestTargetHost());
         // Recommended protocol interceptors
-        httpproc.addInterceptor(new IgnoreConnectMethod(new RequestConnControl()));
+        httpproc.addInterceptor(new RequestConnControl());
         httpproc.addInterceptor(new RequestUserAgent());
         httpproc.addInterceptor(new RequestExpectContinue());
         // HTTP state management interceptors
@@ -334,26 +329,4 @@
         return new DefaultUserTokenHandler();
     }
     
-    // FIXME: remove this class when protocol interceptors in HttpCore
-    // are updated to ignore CONNECT methods
-    static class IgnoreConnectMethod implements HttpRequestInterceptor {
-
-        private final HttpRequestInterceptor interceptor;
-        
-        public IgnoreConnectMethod(final HttpRequestInterceptor interceptor) {
-            super();
-            this.interceptor = interceptor;
-        }
-        
-        public void process(
-                final HttpRequest request, 
-                final HttpContext context) throws HttpException, IOException {
-            String method = request.getRequestLine().getMethod();
-            if (!method.equalsIgnoreCase("CONNECT")) {
-                this.interceptor.process(request, context);
-            }
-        }
-        
-    }
-    
 } // class DefaultHttpClient



Mime
View raw message