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:
@ -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"
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user