浏览代码

Strip \r to avoid sending multiple IRC messages

tags/v0.3.4
Russ Garrett 5 年前
父节点
当前提交
a415d782dd
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3
    1
      httplistener/templates.go

+ 3
- 1
httplistener/templates.go 查看文件

@@ -84,7 +84,9 @@ func (hl *HTTPListener) renderTemplate(tpl_name string, data interface{}) ([]str
84 84
 		return []string{}, errors.New("Nonexistent template")
85 85
 	}
86 86
 	t.Execute(&out, data)
87
-	return strings.Split(out.String(), "\n"), nil
87
+	// The \r character is also a delimiter in IRC so strip it out.
88
+	outStr := strings.Replace(out.String(), "\r", "", -1)
89
+	return strings.Split(outStr, "\n"), nil
88 90
 }
89 91
 
90 92
 // We need this additional struct and function because the GitHub webhook package represents

正在加载...
取消
保存