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

Gzip on error does not show error page #2

Open
leebrooks0 opened this issue Feb 11, 2014 · 9 comments
Open

Gzip on error does not show error page #2

leebrooks0 opened this issue Feb 11, 2014 · 9 comments

Comments

@leebrooks0
Copy link

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

@slogsdon
Copy link
Member

Do you have any example code that recreates the issue that I could look at?

@leebrooks0
Copy link
Author

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//issues/2#issuecomment-34753897
.

@leebrooks0
Copy link
Author

@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()
}

@slogsdon
Copy link
Member

@leebrooks0 Thanks for this. It will help in troubleshooting your issues.

@codegangsta
Copy link
Member

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

@slogsdon
Copy link
Member

@codegangsta From looking at this, what you're describing should correct the issue. I still need to verify that's true, however.

@codegangsta
Copy link
Member

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 :)

@codegangsta
Copy link
Member

I went ahead and fixed this in martini core.

go-martini/martini@06dc3e9

Please confirm that it works on your end

@leebrooks0
Copy link
Author

Oops sorry been busy with other stuff - will get onto it soon

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

3 participants