1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-18 12:14:15 +00:00
This commit is contained in:
astaxie 2013-11-08 18:00:07 +08:00
parent 2a81595c3e
commit 91c7635d0e

View File

@ -8,6 +8,7 @@ import (
"encoding/xml"
"errors"
"fmt"
"html/template"
"io"
"mime"
"net/http"
@ -157,7 +158,7 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
if callback == "" {
return errors.New(`"callback" parameter required`)
}
callback_content := bytes.NewBufferString(callback)
callback_content := bytes.NewBufferString(template.JSEscapeString(callback))
callback_content.WriteString("(")
callback_content.Write(content)
callback_content.WriteString(");\r\n")