[smuxi: 4/8] Engine(-Tests): allow upper-case characters in heuristic URLs (closes GH-182)
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi: 4/8] Engine(-Tests): allow upper-case characters in heuristic URLs (closes GH-182)
- Date: Fri, 28 Nov 2014 11:26:10 +0000 (UTC)
commit e69cc7a63def95f9561b1847ed3eeffb3c53f681
Author: Mirco Bauer <meebey meebey net>
Date: Thu Oct 9 11:43:30 2014 +0200
Engine(-Tests): allow upper-case characters in heuristic URLs (closes GH-182)
src/Engine-Tests/MessageBuilderTests.cs | 11 ++++++-----
src/Engine/Config/MessageBuilderSettings.cs | 5 ++++-
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 9749921..8c9fbdf 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -570,11 +570,6 @@ namespace Smuxi.Engine
[Test]
public void AppendMessageWithNonUrls()
{
- var msg = "ServiceStack.Common";
- var builder = new MessageBuilder();
- builder.TimeStamp = DateTime.MinValue;
- builder.Append(new TextMessagePartModel("ServiceStack.Common"));
- TestMessage(msg, builder.ToMessage());
}
[Test]
@@ -586,6 +581,12 @@ namespace Smuxi.Engine
builder.TimeStamp = DateTime.MinValue;
builder.Append(new TextMessagePartModel("org.gnome.Foo.desktop"));
TestMessage(msg, builder.ToMessage());
+
+ msg = "ServiceStack.Common";
+ builder = new MessageBuilder();
+ builder.TimeStamp = DateTime.MinValue;
+ builder.Append(new TextMessagePartModel("ServiceStack.Common"));
+ TestMessage(msg, builder.ToMessage());
}
[Test]
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index 2475a23..3e65bdd 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -117,7 +117,10 @@ namespace Smuxi.Engine
// Gst.Buffer.Unref() from matching
string heuristic_domain = @"(?:(?:" + subdomain + ")+(?:" + common_tld + ")|localhost)";
string heuristic_address = heuristic_domain + "(?:" + path + ")?";
- regex = new Regex(heuristic_address, RegexOptions.Compiled);
+ regex = new Regex(
+ heuristic_address,
+ RegexOptions.IgnoreCase | RegexOptions.Compiled
+ );
BuiltinPatterns.Add(new MessagePatternModel(regex) {
LinkFormat = "http://{0}"
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]