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
6aaca2ec
Commit
6aaca2ec
authored
Nov 26, 2015
by
nkbai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
router.go Header 毫无用处
context/output.go 简化一下代码,更清晰
parent
f0474214
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
10 deletions
+2
-10
output.go
context/output.go
+2
-6
router.go
router.go
+0
-4
No files found.
context/output.go
View file @
6aaca2ec
...
...
@@ -66,7 +66,6 @@ func (output *BeegoOutput) Body(content []byte) {
if
val
==
"gzip"
{
output
.
Header
(
"Content-Encoding"
,
"gzip"
)
outputWriter
,
_
=
gzip
.
NewWriterLevel
(
output
.
Context
.
ResponseWriter
,
gzip
.
BestSpeed
)
break
}
else
if
val
==
"deflate"
{
output
.
Header
(
"Content-Encoding"
,
"deflate"
)
...
...
@@ -86,11 +85,8 @@ func (output *BeegoOutput) Body(content []byte) {
}
outputWriter
.
Write
(
content
)
switch
outputWriter
.
(
type
)
{
case
*
gzip
.
Writer
:
outputWriter
.
(
*
gzip
.
Writer
)
.
Close
()
case
*
flate
.
Writer
:
outputWriter
.
(
*
flate
.
Writer
)
.
Close
()
if
c
,
ok
:=
outputWriter
.
(
io
.
Closer
);
ok
{
c
.
Close
()
}
}
...
...
router.go
View file @
6aaca2ec
...
...
@@ -897,10 +897,6 @@ type responseWriter struct {
status
int
}
// Header returns the header map that will be sent by WriteHeader.
func
(
w
*
responseWriter
)
Header
()
http
.
Header
{
return
w
.
ResponseWriter
.
Header
()
}
// Write writes the data to the connection as part of an HTTP reply,
// and sets `started` to true.
...
...
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