File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
FirebaseAdmin.Tests/Messaging Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1572,7 +1572,7 @@ public void WebpushNotificationWithLinkUrl()
15721572 Body = "body" ,
15731573 Icon = "icon" ,
15741574 } ,
1575- Options = new WebpushFcmOptions ( )
1575+ FcmOptions = new WebpushFcmOptions ( )
15761576 {
15771577 Link = "https://www.firebase.io/" ,
15781578 } ,
@@ -1618,7 +1618,7 @@ public void WebpushNotificationWithInvalidLinkUrl()
16181618 Body = "body" ,
16191619 Icon = "icon" ,
16201620 } ,
1621- Options = new WebpushFcmOptions ( )
1621+ FcmOptions = new WebpushFcmOptions ( )
16221622 {
16231623 Link = "http://www.firebase.io/" ,
16241624 } ,
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public sealed class WebpushConfig
4848 /// Gets or sets the Webpush options that will be included in the message.
4949 /// </summary>
5050 [ JsonProperty ( "fcm_options" ) ]
51- public WebpushFcmOptions Options { get ; set ; }
51+ public WebpushFcmOptions FcmOptions { get ; set ; }
5252
5353 /// <summary>
5454 /// Copies this Webpush config, and validates the content of it to ensure that it can be
@@ -61,7 +61,7 @@ internal WebpushConfig CopyAndValidate()
6161 Headers = this . Headers ? . Copy ( ) ,
6262 Data = this . Data ? . Copy ( ) ,
6363 Notification = this . Notification ? . CopyAndValidate ( ) ,
64- Options = this . Options ? . CopyAndValidate ( ) ,
64+ FcmOptions = this . FcmOptions ? . CopyAndValidate ( ) ,
6565 } ;
6666 }
6767 }
Original file line number Diff line number Diff line change @@ -35,16 +35,16 @@ public sealed class WebpushFcmOptions
3535 /// </summary>
3636 internal WebpushFcmOptions CopyAndValidate ( )
3737 {
38- if ( this . Link != null && ! this . Link . StartsWith ( "https" ) )
39- {
40- throw new ArgumentException ( "The link options should be a valid https url." ) ;
41- }
42-
4338 var copy = new WebpushFcmOptions ( )
4439 {
4540 Link = this . Link ,
4641 } ;
4742
43+ if ( copy . Link != null && Uri . IsWellFormedUriString ( copy . Link , UriKind . Absolute ) && ! copy . Link . StartsWith ( "https" ) )
44+ {
45+ throw new ArgumentException ( "The link options should be a valid https url." ) ;
46+ }
47+
4848 return copy ;
4949 }
5050 }
You can’t perform that action at this time.
0 commit comments