File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -312,7 +312,7 @@ public class Url : Payload
312
312
private readonly string url ;
313
313
314
314
/// <summary>
315
- /// Generates a link. If not given, http/https protocol will be added.
315
+ /// Generates a link. If the protocol is not specified, the http protocol will be added.
316
316
/// </summary>
317
317
/// <param name="url">Link url target</param>
318
318
public Url ( string url )
@@ -322,7 +322,7 @@ public Url(string url)
322
322
323
323
public override string ToString ( )
324
324
{
325
- return ( ! this . url . StartsWith ( "http" ) ? "http://" + this . url : this . url ) ;
325
+ return ( ! this . url . StartsWith ( "http" , StringComparison . OrdinalIgnoreCase ) ? "http://" + this . url : this . url ) ;
326
326
}
327
327
}
328
328
Original file line number Diff line number Diff line change @@ -757,6 +757,18 @@ public void url_should_build_https()
757
757
}
758
758
759
759
760
+ [ Fact ]
761
+ [ Category ( "PayloadGenerator/Url" ) ]
762
+ public void url_should_build_https_all_caps ( )
763
+ {
764
+ var url = "HTTPS://CODE-BUDE.NET" ;
765
+
766
+ var generator = new PayloadGenerator . Url ( url ) ;
767
+
768
+ generator . ToString ( ) . ShouldBe ( "HTTPS://CODE-BUDE.NET" ) ;
769
+ }
770
+
771
+
760
772
[ Fact ]
761
773
[ Category ( "PayloadGenerator/Url" ) ]
762
774
public void url_should_add_http ( )
You can’t perform that action at this time.
0 commit comments