@@ -340,7 +340,11 @@ private async Task<Result> RequestJsonString(
340340
341341 var request = new HttpRequestMessage ( HttpMethod . Post , uri ) ;
342342
343- request . Headers . Authorization = new AuthenticationHeaderValue ( "Bearer" , this . options . OAuth2AccessToken ) ;
343+ if ( host != HostType . ApiNotify )
344+ {
345+ request . Headers . Authorization = new AuthenticationHeaderValue ( "Bearer" , this . options . OAuth2AccessToken ) ;
346+ }
347+
344348 request . Headers . TryAddWithoutValidation ( "User-Agent" , this . options . UserAgent ) ;
345349
346350 if ( this . selectUser != null )
@@ -576,6 +580,11 @@ internal class HostType
576580 /// Host type for api content.
577581 /// </summary>
578582 public const string ApiContent = "content" ;
583+
584+ /// <summary>
585+ /// Host type for api notify.
586+ /// </summary>
587+ public const string ApiNotify = "notify" ;
579588 }
580589
581590 /// <summary>
@@ -593,6 +602,11 @@ internal sealed class DrpoboxRequestHandlerOptions
593602 /// </summary>
594603 private const string DefaultApiContentDomain = "content.dropboxapi.com" ;
595604
605+ /// <summary>
606+ /// The default api notify domain
607+ /// </summary>
608+ private const string DefaultApiNotifyDomain = "notify.dropboxapi.com" ;
609+
596610 /// <summary>
597611 /// The base user agent, used to construct all user agent strings.
598612 /// </summary>
@@ -613,6 +627,8 @@ internal sealed class DrpoboxRequestHandlerOptions
613627 /// this is for internal Dropbox use only.</param>
614628 /// <param name="apiContentHostname">The hostname that will process api content requests;
615629 /// this is for internal Dropbox use only.</param>
630+ /// <param name="apiNotifyHostname">The hostname that will process api notify requests;
631+ /// this is for internal Dropbox use only.</param>
616632 /// <param name="httpClient">The custom http client. If not provided, a default
617633 /// http client will be created.</param>
618634 public DrpoboxRequestHandlerOptions (
@@ -621,6 +637,7 @@ public DrpoboxRequestHandlerOptions(
621637 string userAgent = null ,
622638 string apiHostname = DefaultApiDomain ,
623639 string apiContentHostname = DefaultApiContentDomain ,
640+ string apiNotifyHostname = DefaultApiNotifyDomain ,
624641 HttpClient httpClient = null )
625642 {
626643 var name = new AssemblyName ( typeof ( DrpoboxRequestHandlerOptions ) . Assembly . FullName ) ;
@@ -636,7 +653,8 @@ public DrpoboxRequestHandlerOptions(
636653 this . HostMap = new Dictionary < string , string >
637654 {
638655 { HostType . Api , apiHostname } ,
639- { HostType . ApiContent , apiContentHostname }
656+ { HostType . ApiContent , apiContentHostname } ,
657+ { HostType . ApiNotify , apiNotifyHostname }
640658 } ;
641659 }
642660
0 commit comments