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
1576add9
Commit
1576add9
authored
Dec 15, 2015
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1488 from astaxie/revert-1487-develop
Revert "compress method fixed"
parents
d6f23afd
58aa0545
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
acceptencoder.go
context/acceptencoder.go
+3
-8
No files found.
context/acceptencoder.go
View file @
1576add9
...
@@ -18,7 +18,6 @@ import (
...
@@ -18,7 +18,6 @@ import (
"bytes"
"bytes"
"compress/flate"
"compress/flate"
"compress/gzip"
"compress/gzip"
"compress/zlib"
"io"
"io"
"net/http"
"net/http"
"os"
"os"
...
@@ -32,13 +31,9 @@ type acceptEncoder struct {
...
@@ -32,13 +31,9 @@ type acceptEncoder struct {
}
}
var
(
var
(
noneCompressEncoder
=
acceptEncoder
{
""
,
func
(
wr
io
.
Writer
,
level
int
)
(
io
.
Writer
,
error
)
{
return
wr
,
nil
}}
noneCompressEncoder
=
acceptEncoder
{
""
,
func
(
wr
io
.
Writer
,
level
int
)
(
io
.
Writer
,
error
)
{
return
wr
,
nil
}}
gzipCompressEncoder
=
acceptEncoder
{
"gzip"
,
func
(
wr
io
.
Writer
,
level
int
)
(
io
.
Writer
,
error
)
{
return
gzip
.
NewWriterLevel
(
wr
,
level
)
}}
gzipCompressEncoder
=
acceptEncoder
{
"gzip"
,
func
(
wr
io
.
Writer
,
level
int
)
(
io
.
Writer
,
error
)
{
return
gzip
.
NewWriterLevel
(
wr
,
level
)
}}
//according to the sec :http://tools.ietf.org/html/rfc2616#section-3.5 ,the deflate compress in http is zlib indeed
deflateCompressEncoder
=
acceptEncoder
{
"deflate"
,
func
(
wr
io
.
Writer
,
level
int
)
(
io
.
Writer
,
error
)
{
return
flate
.
NewWriter
(
wr
,
level
)
}}
//deflate
//The "zlib" format defined in RFC 1950 [31] in combination with
//the "deflate" compression mechanism described in RFC 1951 [29].
deflateCompressEncoder
=
acceptEncoder
{
"deflate"
,
func
(
wr
io
.
Writer
,
level
int
)
(
io
.
Writer
,
error
)
{
return
zlib
.
NewWriterLevel
(
wr
,
level
)
}}
)
)
var
(
var
(
...
...
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