-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix some bugs that download response instead of showing result #6 #8
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
==========================================
+ Coverage 83.33% 83.78% +0.45%
==========================================
Files 1 1
Lines 36 37 +1
==========================================
+ Hits 30 31 +1
Misses 5 5
Partials 1 1
Continue to review full report at Codecov.
|
@@ -34,7 +34,7 @@ import ( | |||
"time" | |||
|
|||
"github.com/gin-contrib/gzip" | |||
"github.com/gin-gonic/gin" | |||
"github.com/gin-gonic/gin.v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, github.com/gin-gonic/gin
is correct.
@@ -8,7 +8,7 @@ import ( | |||
"strings" | |||
"sync" | |||
|
|||
"github.com/gin-gonic/gin" | |||
"gopkg.in/gin-gonic/gin.v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are moving everything back to github.com/gin-gonic/gin
in the time of dependency managers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so what happens if we use gin.v1 in our project ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should replace it with github.com/gin-gonic/gin.
@@ -37,6 +37,7 @@ func Gzip(level int) gin.HandlerFunc { | |||
gz.Reset(c.Writer) | |||
|
|||
c.Header("Content-Encoding", "gzip") | |||
c.Header("Content-Type", "text/html; charset=UTF-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And how do you know that HTML should be returned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default content type is x-gizp and this encoding download the response html !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But who say that you are using gzip only for html?
No description provided.