Gzip on error does not show error page
If there is a server side error GZip returns a file to the browser named latest, and does not display an error in the browser. If you turn Gzip off then you get an error page in the browser which makes debugging a lot easier than having to switch back to the terminal
Do you have any example code that recreates the issue that I could look at?
Will make up an example later to try and replicate this, although so far panic(err) from anywhere seems to do the trick with me.
On Tue, Feb 11, 2014 at 3:30 PM, Shane Logsdon [email protected]:
Do you have any example code that recreates the issue that I could look at?
Reply to this email directly or view it on GitHubhttps://github.com/martini-contrib/gzip/issues/2#issuecomment-34753897 .
@slogsdon this snippet replicates the issue for me.
package main
import (
"github.com/codegangsta/martini"
"github.com/martini-contrib/gzip"
)
func main() {
m := martini.Classic()
m.Use(gzip.All())
m.Get("/", func() string {
panic("Oh noes!")
return "Hello world!"
})
m.Run()
}
@leebrooks0 Thanks for this. It will help in troubleshooting your issues.
This is an interesting problem. It makes me wonder if it would make more sense for the recovery middleware to get the responsewriter after context.Next() is called. That way the error html can still pass through gzipped
@codegangsta From looking at this, what you're describing should correct the issue. I still need to verify that's true, however.
Cool. I can look into testing this out sometime this week. Otherwise if one if you want to take a crack at it you are more than welcome to :)
I went ahead and fixed this in martini core.
https://github.com/codegangsta/martini/commit/06dc3e9688c52f273f9cd8cd833e08b50e49b677
Please confirm that it works on your end
Oops sorry been busy with other stuff - will get onto it soon