{"action":"created","issue":{"url":"https://api.github.com/repos/hacdias/caddy-minify/issues/3","repository_url":"https://api.github.com/repos/hacdias/caddy-minify","labels_url":"https://api.github.com/repos/hacdias/caddy-minify/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/hacdias/caddy-minify/issues/3/comments","events_url":"https://api.github.com/repos/hacdias/caddy-minify/issues/3/events","html_url":"https://github.com/hacdias/caddy-minify/issues/3","id":172318730,"number":3,"title":"Code feedback","user":{"login":"tdewolff","id":5563166,"avatar_url":"https://avatars.githubusercontent.com/u/5563166?v=3","gravatar_id":"","url":"https://api.github.com/users/tdewolff","html_url":"https://github.com/tdewolff","followers_url":"https://api.github.com/users/tdewolff/followers","following_url":"https://api.github.com/users/tdewolff/following{/other_user}","gists_url":"https://api.github.com/users/tdewolff/gists{/gist_id}","starred_url":"https://api.github.com/users/tdewolff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdewolff/subscriptions","organizations_url":"https://api.github.com/users/tdewolff/orgs","repos_url":"https://api.github.com/users/tdewolff/repos","events_url":"https://api.github.com/users/tdewolff/events{/privacy}","received_events_url":"https://api.github.com/users/tdewolff/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hacdias/caddy-minify/labels/enhancement","name":"enhancement","color":"1d76db"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-21T12:25:15Z","updated_at":"2016-08-24T18:24:10Z","closed_at":"2016-08-24T18:24:10Z","body":"I'm not sure how else to give feedback than through an issue, but as the minify author I wanted to give some feedback about the plugin:\r\n\r\n- [x] https://github.com/hacdias/caddy-minify/blob/master/minify.go#L48 you throw an error here as well, is that really what you want when the mimetype parser fails? I think you should just blindly return any content it wants to send\r\n- [x] You could omit the `sanitizeContentType` and use https://godoc.org/github.com/tdewolff/minify#M.AddRegexp instead for XML and JSON. Possibly also for JS\r\n- [x] https://github.com/hacdias/caddy-minify/blob/master/setup.go#L19 you are adding minifiers by their file extension, but you should use their mimetype (such as `text/html`). That way embedded scripts and styles get minified as well \r\n- [x] https://github.com/hacdias/caddy-minify/blob/master/minify.go#L62 whenever minification fails, you return an error here. But this is probably not what the user wants. I think it is more useful to emit a warning and return the original content instead. The `Bytes` function will return the original content whenever it encounters an error, so just use that instead and emit a warning\r\n- [ ] I think you should omit the buffer at https://github.com/hacdias/caddy-minify/blob/master/minify.go#L35 and use streams instead, see https://github.com/tdewolff/minify#responsewriter for an example. This lowers memory footprint"},"comment":{"url":"https://api.github.com/repos/hacdias/caddy-minify/issues/comments/242162449","html_url":"https://github.com/hacdias/caddy-minify/issues/3#issuecomment-242162449","issue_url":"https://api.github.com/repos/hacdias/caddy-minify/issues/3","id":242162449,"user":{"login":"hacdias","id":5447088,"avatar_url":"https://avatars.githubusercontent.com/u/5447088?v=3","gravatar_id":"","url":"https://api.github.com/users/hacdias","html_url":"https://github.com/hacdias","followers_url":"https://api.github.com/users/hacdias/followers","following_url":"https://api.github.com/users/hacdias/following{/other_user}","gists_url":"https://api.github.com/users/hacdias/gists{/gist_id}","starred_url":"https://api.github.com/users/hacdias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hacdias/subscriptions","organizations_url":"https://api.github.com/users/hacdias/orgs","repos_url":"https://api.github.com/users/hacdias/repos","events_url":"https://api.github.com/users/hacdias/events{/privacy}","received_events_url":"https://api.github.com/users/hacdias/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T18:24:10Z","updated_at":"2016-08-24T18:24:10Z","body":"Hey @tdewolff!\r\n\r\nI'll close this issue, as the main \"mini-issues\" are solved. Unfortunately, I think we can't do anything about the fifth one.\r\n\r\nAnyway, thank you everything and for all of your suggestions. They were very helpful! :D"}}
{"actor":{"display_login":"hacdias"}}