mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:00:55 +00:00
fix #283
This commit is contained in:
parent
2a81595c3e
commit
91c7635d0e
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user