diff --git a/QRCoder/PayloadGenerator.cs b/QRCoder/PayloadGenerator.cs
index 48336a73..031b4cc8 100644
--- a/QRCoder/PayloadGenerator.cs
+++ b/QRCoder/PayloadGenerator.cs
@@ -311,7 +311,7 @@ public class Url : Payload
private readonly string url;
///
- /// Generates a link. If not given, http/https protocol will be added.
+ /// Generates a link. If the protocol is not specified, the http protocol will be added.
///
/// Link url target
public Url(string url)
@@ -321,7 +321,7 @@ public Url(string url)
public override string ToString()
{
- return (!this.url.StartsWith("http") ? "http://" + this.url : this.url);
+ return (!this.url.StartsWith("http", StringComparison.OrdinalIgnoreCase) ? "http://" + this.url : this.url);
}
}
diff --git a/QRCoderTests/PayloadGeneratorTests.cs b/QRCoderTests/PayloadGeneratorTests.cs
index 2e90e3ce..1500f124 100644
--- a/QRCoderTests/PayloadGeneratorTests.cs
+++ b/QRCoderTests/PayloadGeneratorTests.cs
@@ -744,6 +744,18 @@ public void url_should_build_https()
}
+ [Fact]
+ [Category("PayloadGenerator/Url")]
+ public void url_should_build_https_all_caps()
+ {
+ var url = "HTTPS://CODE-BUDE.NET";
+
+ var generator = new PayloadGenerator.Url(url);
+
+ generator.ToString().ShouldBe("HTTPS://CODE-BUDE.NET");
+ }
+
+
[Fact]
[Category("PayloadGenerator/Url")]
public void url_should_add_http()