Skip to content

Commit

Permalink
Support the JSONP
Browse files Browse the repository at this point in the history
  • Loading branch information
shibingli committed Apr 11, 2017
1 parent 94df552 commit 861dbc2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/apibox.club/website/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ var upgrader = websocket.Upgrader{
cwl := Conf.Web.CorsWhiteList
apibox.Log_Debug("Cors white list:", cwl)
apibox.Log_Debug("Request Host:", cwl)

for _, v := range strings.Split(cwl, ",") {
if strings.EqualFold(strings.TrimSpace(v), r.Host) {
return true
Expand Down
1 change: 0 additions & 1 deletion src/apibox.club/website/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ func (c *Context) OutJson(obj interface{}) {
if Conf.Web.EnableJSONP {
jsonpParam := c.GetFormValue(Conf.Web.JSONPParam)
ret := jsonpParam + "(" + string(b) + ")"
apibox.Log_Debug("JSONP:", ret)
apibox.Gzip_Binary([]byte(ret), c.w, c.r)
} else {
apibox.Gzip_Binary(b, c.w, c.r)
Expand Down

0 comments on commit 861dbc2

Please sign in to comment.