91c7635d by astaxie

fix #283

1 parent 2a81595c
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
8 "encoding/xml" 8 "encoding/xml"
9 "errors" 9 "errors"
10 "fmt" 10 "fmt"
11 "html/template"
11 "io" 12 "io"
12 "mime" 13 "mime"
13 "net/http" 14 "net/http"
...@@ -157,7 +158,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error { ...@@ -157,7 +158,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
157 if callback == "" { 158 if callback == "" {
158 return errors.New(`"callback" parameter required`) 159 return errors.New(`"callback" parameter required`)
159 } 160 }
160 callback_content := bytes.NewBufferString(callback) 161 callback_content := bytes.NewBufferString(template.JSEscapeString(callback))
161 callback_content.WriteString("(") 162 callback_content.WriteString("(")
162 callback_content.Write(content) 163 callback_content.Write(content)
163 callback_content.WriteString(");\r\n") 164 callback_content.WriteString(");\r\n")
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!