fix #283
Showing
1 changed file
with
2 additions
and
1 deletions
| ... | @@ -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") | ... | ... |
-
Please register or sign in to post a comment