chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1754078 - in /chemistry/portcmis/trunk/PortCMIS: binding/BindingIntf.cs binding/HttpPortable.cs const/ClientVersion.cs
Date Tue, 26 Jul 2016 07:50:08 GMT
Author: fmui
Date: Tue Jul 26 07:50:08 2016
New Revision: 1754078

URL: http://svn.apache.org/viewvc?rev=1754078&view=rev
Log:
PortCMIS: added support for custom HttpClientHandlers

Modified:
    chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs
    chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs
    chemistry/portcmis/trunk/PortCMIS/const/ClientVersion.cs

Modified: chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs
URL: http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs?rev=1754078&r1=1754077&r2=1754078&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs Tue Jul 26 07:50:08 2016
@@ -263,6 +263,15 @@ namespace PortCMIS.Binding
     public interface IPortableAuthenticationProvider : IAuthenticationProvider
     {
         /// <summary>
+        /// Creates a HttpClientHandler object.
+        /// </summary>
+        /// <remarks>
+        /// If this method returns <c>null</c>, a default HttpClientHandler object
will be created.
+        /// </remarks>
+        /// <returns>a new HttpClientHandler object</returns>
+        HttpClientHandler CreateHttpClientHandler();
+
+        /// <summary>
         /// Prepares the HTTP client handler before it is used.
         /// </summary>
         /// <param name="httpClientHandler">the HTTP client handler</param>
@@ -315,6 +324,12 @@ namespace PortCMIS.Binding
         public string ProxyPassword { get { return Session.GetValue(SessionParameter.ProxyPassword)
as string; } }
 
         /// <inheritdoc/>
+        public virtual HttpClientHandler CreateHttpClientHandler()
+        {
+            return null;
+        }
+
+        /// <inheritdoc/>
         public virtual void PrepareHttpClientHandler(HttpClientHandler httpClientHandler)
         {
             httpClientHandler.PreAuthenticate = true;

Modified: chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs
URL: http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs?rev=1754078&r1=1754077&r2=1754078&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs Tue Jul 26 07:50:08 2016
@@ -88,8 +88,17 @@ namespace PortCMIS.Binding.Http
                     httpClient = session.GetValue(InvokerHttpClient) as HttpClient;
                     if (httpClient == null)
                     {
+                        // create a HTTP client handler
+                        HttpClientHandler httpClientHandler = null;
 
-                        HttpClientHandler httpClientHandler = new HttpClientHandler();
+                        if (authProvider != null)
+                        {
+                            httpClientHandler = authProvider.CreateHttpClientHandler();
+                        }
+                        if (httpClientHandler == null)
+                        {
+                            httpClientHandler = new HttpClientHandler();
+                        }
 
                         // redirects
                         if (httpClientHandler.SupportsRedirectConfiguration)

Modified: chemistry/portcmis/trunk/PortCMIS/const/ClientVersion.cs
URL: http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/const/ClientVersion.cs?rev=1754078&r1=1754077&r2=1754078&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/const/ClientVersion.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/const/ClientVersion.cs Tue Jul 26 07:50:08 2016
@@ -25,7 +25,7 @@ namespace PortCMIS
     public class ClientVersion
     {
         /// <summary>PortCMIS user agent name</summary>
-        public const string UserAgentName = "ApacheChemistryPortCMIS";
+        public const string UserAgentName = "Apache-Chemistry-PortCMIS";
 
         /// <summary>PortCMIS version</summary>
         public const string Version = "0.2";



Mime
View raw message