1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-14 04:50:40 +00:00

change this to short name

This commit is contained in:
astaxie
2014-11-05 22:40:31 +08:00
parent 950ff91d87
commit 54ba307f7f
5 changed files with 44 additions and 44 deletions

View File

@ -14,7 +14,7 @@ type MainController struct {
beego.Controller
}
func (this *MainController) Get() {
this.Data["host"] = this.Ctx.Request.Host
this.TplNames = "index.tpl"
func (m *MainController) Get() {
m.Data["host"] = m.Ctx.Request.Host
m.TplNames = "index.tpl"
}

View File

@ -154,10 +154,10 @@ var upgrader = websocket.Upgrader{
WriteBufferSize: 1024,
}
func (this *WSController) Get() {
ws, err := upgrader.Upgrade(this.Ctx.ResponseWriter, this.Ctx.Request, nil)
func (w *WSController) Get() {
ws, err := upgrader.Upgrade(w.Ctx.ResponseWriter, w.Ctx.Request, nil)
if _, ok := err.(websocket.HandshakeError); ok {
http.Error(this.Ctx.ResponseWriter, "Not a websocket handshake", 400)
http.Error(w.Ctx.ResponseWriter, "Not a websocket handshake", 400)
return
} else if err != nil {
return