Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mostafasolati
Copy link

No description provided.

@codecov-io
Copy link

codecov-io commented Apr 4, 2017

Codecov Report

Merging #8 into master will increase coverage by 0.45%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
gzip.go 83.78% <100%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6743ec8...7987fdb. Read the comment docs.

@@ -34,7 +34,7 @@ import (
"time"

"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin.v1"
Copy link

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"
Copy link

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.

Copy link
Author

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 ?

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")
Copy link

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?

Copy link
Author

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 !

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?

@MTRNord MTRNord mentioned this pull request Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants