From da91565354ac3edb540365f7ce9c44e30d7a5990 Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 10 Sep 2013 17:02:56 +0800 Subject: [PATCH] add iswebsocket method --- context/input.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/context/input.go b/context/input.go index bbdda3a8..303f10cc 100644 --- a/context/input.go +++ b/context/input.go @@ -74,6 +74,10 @@ func (input *BeegoInput) IsSecure() bool { return input.Scheme() == "https" } +func (input *BeegoInput) IsWebsocket() bool { + return input.Header("Upgrade") == "websocket" +} + func (input *BeegoInput) IsUpload() bool { return input.req.MultipartForm != nil }