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
860568cb
Commit
860568cb
authored
Nov 06, 2015
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified as astaxie reviews
https://github.com/astaxie/beego/pull/1376
parent
1abf85ed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
config.go
config.go
+0
-1
memzipfile.go
memzipfile.go
+3
-3
staticfile.go
staticfile.go
+1
-2
No files found.
config.go
View file @
860568cb
...
@@ -529,7 +529,6 @@ func ParseConfig() (err error) {
...
@@ -529,7 +529,6 @@ func ParseConfig() (err error) {
if
ext
==
""
{
if
ext
==
""
{
continue
continue
}
}
ext
=
strings
.
ToLower
(
ext
)
if
!
strings
.
HasPrefix
(
ext
,
"."
)
{
if
!
strings
.
HasPrefix
(
ext
,
"."
)
{
ext
=
"."
+
ext
ext
=
"."
+
ext
}
}
...
...
memzipfile.go
View file @
860568cb
...
@@ -206,9 +206,9 @@ func getAcceptEncodingZip(r *http.Request) string {
...
@@ -206,9 +206,9 @@ func getAcceptEncodingZip(r *http.Request) string {
ss
=
strings
.
ToLower
(
ss
)
ss
=
strings
.
ToLower
(
ss
)
if
strings
.
Contains
(
ss
,
"gzip"
)
{
if
strings
.
Contains
(
ss
,
"gzip"
)
{
return
"gzip"
return
"gzip"
}
}
else
if
strings
.
Contains
(
ss
,
"deflate"
)
{
if
strings
.
Contains
(
ss
,
"deflate"
)
{
return
"deflate"
return
"deflate"
}
}
else
{
return
""
return
""
}
}
}
staticfile.go
View file @
860568cb
...
@@ -96,9 +96,8 @@ func serverStaticRouter(ctx *context.Context) {
...
@@ -96,9 +96,8 @@ func serverStaticRouter(ctx *context.Context) {
}
}
isStaticFileToCompress
:=
false
isStaticFileToCompress
:=
false
lowerFileName
:=
strings
.
ToLower
(
filePath
)
for
_
,
statExtension
:=
range
StaticExtensionsToGzip
{
for
_
,
statExtension
:=
range
StaticExtensionsToGzip
{
if
strings
.
HasSuffix
(
lowerFileName
,
statExtension
)
{
if
strings
.
HasSuffix
(
strings
.
ToLower
(
filePath
),
strings
.
ToLower
(
statExtension
)
)
{
isStaticFileToCompress
=
true
isStaticFileToCompress
=
true
break
break
}
}
...
...
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