{"action":"created","issue":{"url":"https://api.github.com/repos/NYTimes/gziphandler/issues/40","repository_url":"https://api.github.com/repos/NYTimes/gziphandler","labels_url":"https://api.github.com/repos/NYTimes/gziphandler/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/NYTimes/gziphandler/issues/40/comments","events_url":"https://api.github.com/repos/NYTimes/gziphandler/issues/40/events","html_url":"https://github.com/NYTimes/gziphandler/issues/40","id":218269326,"number":40,"title":"Gzip based on response content type","user":{"login":"sajal","id":25007,"avatar_url":"https://avatars3.githubusercontent.com/u/25007?v=3","gravatar_id":"","url":"https://api.github.com/users/sajal","html_url":"https://github.com/sajal","followers_url":"https://api.github.com/users/sajal/followers","following_url":"https://api.github.com/users/sajal/following{/other_user}","gists_url":"https://api.github.com/users/sajal/gists{/gist_id}","starred_url":"https://api.github.com/users/sajal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sajal/subscriptions","organizations_url":"https://api.github.com/users/sajal/orgs","repos_url":"https://api.github.com/users/sajal/repos","events_url":"https://api.github.com/users/sajal/events{/privacy}","received_events_url":"https://api.github.com/users/sajal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-30T17:24:46Z","updated_at":"2017-04-03T14:42:05Z","closed_at":null,"body":"I see now `GzipResponseWriter` can [decide](https://github.com/NYTimes/gziphandler/blob/9d655ed18f36edb11d06469a0aefee31458d96a4/gzip.go#L107) if it wants to gzip the response based on response size. \r\n\r\nI suggest also filtering on content-types. The types could be user configured or hardcoded to [sane defaults](https://github.com/h5bp/server-configs-nginx/blob/cb3dc0554eb54ccfab34bfcf32988dfce1872ec2/nginx.conf#L91)\r\n\r\n\tif _, ok := w.Header()[contentType]; !ok {\r\n\t\t// It infer it from the uncompressed body.\r\n\t\tw.Header().Set(contentType, http.DetectContentType(b))\r\n\t}\r\n\t//Use the content-type information to decide between `w.startGzip()` and `w.startNoGzip()`"},"comment":{"url":"https://api.github.com/repos/NYTimes/gziphandler/issues/comments/291164083","html_url":"https://github.com/NYTimes/gziphandler/issues/40#issuecomment-291164083","issue_url":"https://api.github.com/repos/NYTimes/gziphandler/issues/40","id":291164083,"user":{"login":"adammck","id":19543,"avatar_url":"https://avatars0.githubusercontent.com/u/19543?v=3","gravatar_id":"","url":"https://api.github.com/users/adammck","html_url":"https://github.com/adammck","followers_url":"https://api.github.com/users/adammck/followers","following_url":"https://api.github.com/users/adammck/following{/other_user}","gists_url":"https://api.github.com/users/adammck/gists{/gist_id}","starred_url":"https://api.github.com/users/adammck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adammck/subscriptions","organizations_url":"https://api.github.com/users/adammck/orgs","repos_url":"https://api.github.com/users/adammck/repos","events_url":"https://api.github.com/users/adammck/events{/privacy}","received_events_url":"https://api.github.com/users/adammck/received_events","type":"User","site_admin":false},"created_at":"2017-04-03T14:42:05Z","updated_at":"2017-04-03T14:42:05Z","body":"I like config structs, but I don't think this functionality belongs in this middleware. I'm not strongly against it, and the implementation would be trivial, but I'd like to hear some concrete use-cases first. I rarely encounter endpoints which may or may not want their responses compressed."}}
{"actor":{"display_login":"adammck"}}