Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
2ddda596
Commit
2ddda596
authored
Dec 22, 2015
by
fud
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/astaxie/beego
into develop
parents
bbd42ce1
25337aec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
context.go
context/context.go
+27
-0
No files found.
context/context.go
View file @
2ddda596
...
...
@@ -23,10 +23,13 @@
package
context
import
(
"bufio"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"errors"
"fmt"
"net"
"net/http"
"strconv"
"strings"
...
...
@@ -188,3 +191,27 @@ func (w *Response) WriteHeader(code int) {
w
.
Started
=
true
w
.
ResponseWriter
.
WriteHeader
(
code
)
}
// Hijack hijacker for http
func
(
w
*
Response
)
Hijack
()
(
net
.
Conn
,
*
bufio
.
ReadWriter
,
error
)
{
hj
,
ok
:=
w
.
ResponseWriter
.
(
http
.
Hijacker
)
if
!
ok
{
return
nil
,
nil
,
errors
.
New
(
"webserver doesn't support hijacking"
)
}
return
hj
.
Hijack
()
}
// Flush http.Flusher
func
(
w
*
Response
)
Flush
()
{
if
f
,
ok
:=
w
.
ResponseWriter
.
(
http
.
Flusher
);
ok
{
f
.
Flush
()
}
}
// CloseNotify http.CloseNotifier
func
(
w
*
Response
)
CloseNotify
()
<-
chan
bool
{
if
cn
,
ok
:=
w
.
ResponseWriter
.
(
http
.
CloseNotifier
);
ok
{
return
cn
.
CloseNotify
()
}
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment