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

The gzip do not work #10

Open
rockxsj opened this issue Aug 19, 2014 · 0 comments
Open

The gzip do not work #10

rockxsj opened this issue Aug 19, 2014 · 0 comments

Comments

@rockxsj
Copy link

rockxsj commented Aug 19, 2014

package main

import (
    "github.com/go-martini/martini"
    "github.com/martini-contrib/gzip"
)

func main() {
    m := martini.Classic()
    m.Use(gzip.All())
    addRouter(m)
    m.RunOnAddr("0.0.0.0:8089")
}

func addRouter(m *martini.ClassicMartini) {
    m.Get("/:name", show)
}

func show(params martini.Params) (int, string) {
    println("hhhhhhh")
    return 200, "bbbb" + params["name"]
}

does not work! And the chrome will show the downloader.

package main

import (
    "github.com/go-martini/martini"
    "github.com/martini-contrib/gzip"
)

func main() {
    m := martini.Classic()
    m.Use(gzip.All())
    //addRouter(m)
    m.Get("/aa", func() string {
        return "aaaaa"
    })
    m.RunOnAddr("0.0.0.0:8089")
}

/*
func addRouter(m *martini.ClassicMartini) {
    m.Get("/:name", show)
}

func show(params martini.Params) (int, string) {
    println("hhhhhhh")
    return 200, "bbbb" + params["name"]
}
*/

work well!

package main

import (
    "github.com/go-martini/martini"
    //"github.com/martini-contrib/gzip"
)

func main() {
    m := martini.Classic()
    //m.Use(gzip.All())
    addRouter(m)
    m.RunOnAddr("0.0.0.0:8089")
}

func addRouter(m *martini.ClassicMartini) {
    m.Get("/:name", show)
}

func show(params martini.Params) (int, string) {
    println("hhhhhhh")
    return 200, "bbbb" + params["name"]
}

work well!

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

No branches or pull requests

1 participant