{"action":"created","issue":{"url":"https://api.github.com/repos/MiniProfiler/rack-mini-profiler/issues/134","labels_url":"https://api.github.com/repos/MiniProfiler/rack-mini-profiler/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/MiniProfiler/rack-mini-profiler/issues/134/comments","events_url":"https://api.github.com/repos/MiniProfiler/rack-mini-profiler/issues/134/events","html_url":"https://github.com/MiniProfiler/rack-mini-profiler/issues/134","id":69205430,"number":134,"title":"Enabling and disabling is broken in production environment","user":{"login":"dalibor","id":48384,"avatar_url":"https://avatars.githubusercontent.com/u/48384?v=3","gravatar_id":"","url":"https://api.github.com/users/dalibor","html_url":"https://github.com/dalibor","followers_url":"https://api.github.com/users/dalibor/followers","following_url":"https://api.github.com/users/dalibor/following{/other_user}","gists_url":"https://api.github.com/users/dalibor/gists{/gist_id}","starred_url":"https://api.github.com/users/dalibor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalibor/subscriptions","organizations_url":"https://api.github.com/users/dalibor/orgs","repos_url":"https://api.github.com/users/dalibor/repos","events_url":"https://api.github.com/users/dalibor/events{/privacy}","received_events_url":"https://api.github.com/users/dalibor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-17T19:50:16Z","updated_at":"2015-07-31T10:48:59Z","closed_at":null,"body":"I want to have `rack-mini-profiler` disabled by default and be able to enable it with `?pp=enable`.\r\n\r\nIn Gemfile:\r\n\r\n```ruby\r\ngem 'flamegraph'\r\ngem 'rack-mini-profiler'\r\n```\r\n\r\nIn initializer:\r\n\r\n```ruby\r\nRack::MiniProfiler.config.enabled = false\r\n```\r\n\r\nIn ApplicationController:\r\n\r\n```ruby\r\nbefore_filter :enable_porfiler\r\ndef enable_porfiler\r\n  Rack::MiniProfiler.authorize_request\r\nend\r\n```\r\n\r\nIn development environment it works as expected. By default, it's disabled. I can enable it with `?pp=enable`, disable it with `?pp=disable`, etc.\r\n\r\nIn production environment it does not work as expected. It's disabled by default, but I cannot enable it with `?pp=enable`. Also, if I remove the initializer, then the profiler shows, but it shows on the second page refresh which seems as not expected? Then I can disable it with `?pp=disable` but cannot enable it again. So, something is funky and it's not consistent with how enable/disable works in development environment."},"comment":{"url":"https://api.github.com/repos/MiniProfiler/rack-mini-profiler/issues/comments/126648241","html_url":"https://github.com/MiniProfiler/rack-mini-profiler/issues/134#issuecomment-126648241","issue_url":"https://api.github.com/repos/MiniProfiler/rack-mini-profiler/issues/134","id":126648241,"user":{"login":"nateberkopec","id":845662,"avatar_url":"https://avatars.githubusercontent.com/u/845662?v=3","gravatar_id":"","url":"https://api.github.com/users/nateberkopec","html_url":"https://github.com/nateberkopec","followers_url":"https://api.github.com/users/nateberkopec/followers","following_url":"https://api.github.com/users/nateberkopec/following{/other_user}","gists_url":"https://api.github.com/users/nateberkopec/gists{/gist_id}","starred_url":"https://api.github.com/users/nateberkopec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nateberkopec/subscriptions","organizations_url":"https://api.github.com/users/nateberkopec/orgs","repos_url":"https://api.github.com/users/nateberkopec/repos","events_url":"https://api.github.com/users/nateberkopec/events{/privacy}","received_events_url":"https://api.github.com/users/nateberkopec/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T10:48:59Z","updated_at":"2015-07-31T10:48:59Z","body":"@dalibor @EtienneDepaulis Right, if you're using Rack::Deflater (or any other number of \"gzip\" gems that may use it) you need to make sure Rack::MiniProfiler is inserted in the correct order.\r\n\r\nOtherwise RMP will try to insert html into an already-gzipped response, which isn't gonna work."}}