Giter Club home page Giter Club logo

gzip's People

Contributors

sidbusy avatar unknwon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gzip's Issues

panic时不显示错误页面

package main

import (
	"github.com/go-macaron/gzip"
	"gopkg.in/macaron.v1"
)

func main() {
	m := macaron.Classic()
	m.Use(gzip.Gziper())
	m.Get("/", myHandler)
	m.Run()
}

func myHandler(ctx *macaron.Context) {
	panic("test")
	ctx.Resp.Write([]byte("the request path is: " + ctx.Req.RequestURI))
}

加入gzip中间件后,panic时不显示错误页面,请求修复

Ability to selectively disable gzip via a middleware

Hi!
Thanks for creating macaron, it's amazing!

We have a usecase where some client libraries don't play nice with gzipped content
It'd be great if gzipping can be turned off for specific routes via a middleware

proxied requests get double compressed

we have a use case where requests are conditionally proxied to another service. That other service will already compress the response, but this middleware is compressing the body a second time.

It seems like this handler should exit early if there is already a "Content-Encoding: gzip" header already set on the response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.