mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 12:01:28 +00:00
remove websocket logic because not support handler
This commit is contained in:
parent
2f8a70d548
commit
3db9633ebd
@ -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}
|
||||||
|
|
||||||
|
if RunMode == "dev" {
|
||||||
w.Header().Set("Server", BeegoServerName)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user