Skip to content

Instantly share code, notes, and snippets.

@jkraemer
Created August 11, 2010 16:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkraemer/519273 to your computer and use it in GitHub Desktop.
Save jkraemer/519273 to your computer and use it in GitHub Desktop.
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('../lib/devise_basic_auth_fix', __FILE__)
use DeviseBasicAuthFix
run MyApp::Application
##
# Rack middleware for removing basic auth headers from requests
# see http://github.com/plataformatec/devise/issues/issue/178 for an explanation of why and when this is needed...
#
# === Examples:
#
# use DeviseBasicAuthFix
#
#
class DeviseBasicAuthFix
def initialize(app)
@app = app
end
def call(env)
env['HTTP_AUTHORIZATION'] = nil
@app.call(env)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment