Revision | 115 (tree) |
---|---|
Zeit | 2020-08-13 22:54:31 |
Autor | ![]() |
* Slack通知は半角スペースを + ではなく %20 でエンコードする
* 1.0.33
@@ -91,9 +91,15 @@ | ||
91 | 91 | var subject = string.Format("[{0}] {1}", data.HostName, GetSubject(data.Message)); |
92 | 92 | if (!Util.IsNullOrEmpty(data.Name)) |
93 | 93 | subject = string.Format("[{0}]{1}", data.Name, subject); |
94 | - Send(string.Concat("payload=", HttpUtility.UrlEncode(GetJSON(subject, text.ToString())))); | |
94 | + Send(string.Concat("payload=", Encode(GetJSON(subject, text.ToString())))); | |
95 | 95 | } |
96 | 96 | |
97 | + private string Encode(string value) | |
98 | + { | |
99 | + var result = WebUtility.UrlEncode(value); | |
100 | + return result.Replace("+", "%20"); | |
101 | + } | |
102 | + | |
97 | 103 | private string GetSubject(string value) |
98 | 104 | { |
99 | 105 | if (!string.IsNullOrEmpty(value)) { |
@@ -141,7 +147,7 @@ | ||
141 | 147 | req.Method = "POST"; |
142 | 148 | req.ContentType = "application/x-www-form-urlencoded"; |
143 | 149 | req.ContentLength = data.Length; |
144 | - | |
150 | + | |
145 | 151 | using (Stream s = req.GetRequestStream()) { |
146 | 152 | s.Write(data, 0, data.Length); |
147 | 153 | } |
@@ -24,5 +24,5 @@ | ||
24 | 24 | // |
25 | 25 | // You can specify all the values or you can use the default the Revision and |
26 | 26 | // Build Numbers by using the '*' as shown below: |
27 | -[assembly: AssemblyVersion ("1.0.32")] | |
27 | +[assembly: AssemblyVersion ("1.0.33")] | |
28 | 28 | //[assembly: log4net.Config.XmlConfigurator(ConfigFile=@"Log4net.Config.xml", Watch=true)] |
@@ -30,7 +30,8 @@ | ||
30 | 30 | { |
31 | 31 | var actionTable = LogMatcher.Match(_config.ServerRules, LogData); |
32 | 32 | if(!Util.IsNullOrEmpty(actionTable)) { |
33 | - LogData.Name = LogData.Name ?? _config.General.Name; | |
33 | + if(LogData.Name == null && _config.General != null) | |
34 | + LogData.Name = _config.General.Name; | |
34 | 35 | ActionExecutor.ExecuteAction(actionTable.Actions, LogData); |
35 | 36 | } |
36 | 37 | } |
@@ -28,4 +28,4 @@ | ||
28 | 28 | // |
29 | 29 | // You can specify all the values or you can use the default the Revision and |
30 | 30 | // Build Numbers by using the '*' as shown below: |
31 | -[assembly: AssemblyVersion("1.0.32")] | |
31 | +[assembly: AssemblyVersion("1.0.33")] |
@@ -28,4 +28,4 @@ | ||
28 | 28 | // |
29 | 29 | // You can specify all the values or you can use the default the Revision and |
30 | 30 | // Build Numbers by using the '*' as shown below: |
31 | -[assembly: AssemblyVersion("1.0.32")] | |
31 | +[assembly: AssemblyVersion("1.0.33")] |
@@ -28,4 +28,4 @@ | ||
28 | 28 | // |
29 | 29 | // You can specify all the values or you can use the default the Revision and |
30 | 30 | // Build Numbers by using the '*' as shown below: |
31 | -[assembly: AssemblyVersion("1.0.32")] | |
31 | +[assembly: AssemblyVersion("1.0.33")] |