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
0bc70e88
Commit
0bc70e88
authored
Nov 10, 2015
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignore the other compress method
parent
3872c483
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
acceptencoder.go
acceptencoder/acceptencoder.go
+7
-5
No files found.
acceptencoder/acceptencoder.go
View file @
0bc70e88
...
@@ -26,11 +26,6 @@ import (
...
@@ -26,11 +26,6 @@ import (
"gopkg.in/bufio.v1"
"gopkg.in/bufio.v1"
)
)
type
q
struct
{
name
string
value
float64
}
// WriteFile reads from file and writes to writer by the specific encoding(gzip/deflate)
// WriteFile reads from file and writes to writer by the specific encoding(gzip/deflate)
func
WriteFile
(
encoding
string
,
writer
io
.
Writer
,
file
*
os
.
File
)
(
bool
,
string
,
error
)
{
func
WriteFile
(
encoding
string
,
writer
io
.
Writer
,
file
*
os
.
File
)
(
bool
,
string
,
error
)
{
...
@@ -55,6 +50,9 @@ func writeLevel(encoding string, writer io.Writer, reader io.Reader, level int)
...
@@ -55,6 +50,9 @@ func writeLevel(encoding string, writer io.Writer, reader io.Reader, level int)
case
"deflate"
:
case
"deflate"
:
outputWriter
,
err
=
flate
.
NewWriter
(
writer
,
level
)
outputWriter
,
err
=
flate
.
NewWriter
(
writer
,
level
)
default
:
default
:
// all the other compress methods will ignore
// such as the deprecated compress and chrome-only sdch
encoding
=
""
outputWriter
=
writer
.
(
io
.
Writer
)
outputWriter
=
writer
.
(
io
.
Writer
)
}
}
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -81,6 +79,10 @@ func ParseEncoding(r *http.Request) string {
...
@@ -81,6 +79,10 @@ func ParseEncoding(r *http.Request) string {
return
parseEncoding
(
r
)
return
parseEncoding
(
r
)
}
}
type
q
struct
{
name
string
value
float64
}
func
parseEncoding
(
r
*
http
.
Request
)
string
{
func
parseEncoding
(
r
*
http
.
Request
)
string
{
acceptEncoding
:=
r
.
Header
.
Get
(
"Accept-Encoding"
)
acceptEncoding
:=
r
.
Header
.
Get
(
"Accept-Encoding"
)
...
...
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