1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 21:01:31 +00:00

remove websocket logic because not support handler

This commit is contained in:
astaxie 2014-06-11 11:12:17 +08:00
parent 2f8a70d548
commit 3db9633ebd

View File

@ -524,7 +524,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
var routerInfo *controllerInfo var routerInfo *controllerInfo
w := &responseWriter{writer: rw} w := &responseWriter{writer: rw}
w.Header().Set("Server", BeegoServerName)
if RunMode == "dev" {
w.Header().Set("Server", BeegoServerName)
}
// init context // init context
context := &beecontext.Context{ context := &beecontext.Context{
@ -536,10 +539,6 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
context.Output.Context = context context.Output.Context = context
context.Output.EnableGzip = EnableGzip context.Output.EnableGzip = EnableGzip
if context.Input.IsWebsocket() {
context.ResponseWriter = rw
}
// defined filter function // defined filter function
do_filter := func(pos int) (started bool) { do_filter := func(pos int) (started bool) {
if p.enableFilter { if p.enableFilter {
@ -702,7 +701,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
} }
//render template //render template
if !w.started && !context.Input.IsWebsocket() { if !w.started {
if AutoRender { if AutoRender {
if err := execController.Render(); err != nil { if err := execController.Render(); err != nil {
panic(err) panic(err)