Last active
December 12, 2015 07:18
-
-
Save ericboehs/4735037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/better_errors.rb | |
module BetterErrors | |
def self.allow_remote | |
@allow_remote | |
end | |
def self.allow_remote=(allow_remote=false) | |
@allow_remote = allow_remote | |
end | |
class Middleware | |
def call(env) | |
if local_request?(env) || BetterErrors.allow_remote || ENV['BE_ALLOW_REMOTE'] | |
better_errors_call env | |
else | |
@app.call env | |
end | |
end | |
end | |
end | |
BetterErrors.allow_remote = true if defined? BetterErrors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment