Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overriding ActiveResource::Connection clobbers any other HTTP Basic Auth #3

Open
theworkerant opened this issue Apr 28, 2010 · 2 comments

Comments

@theworkerant
Copy link

The code below makes it impossible to use Basic Auth anywhere else in your app once the lighthouse API gem is included.

Why not set self.user and self.password on the Lighthouse::Base which inherits from ActiveResource?

module ActiveResource
  class Connection
    private
      def authorization_header
        (Lighthouse.email || Lighthouse.password ? { 'Authorization' => 'Basic ' + ["#{Lighthouse.email}:#{Lighthouse.password}"].pack('m').delete("\r\n") } : {})
      end
  end
end 
@technoweenie
Copy link
Collaborator

The lighthouse gem was written when active resource was still beta, so it's likely the feature just didn't exist.

@theworkerant
Copy link
Author

Oh.

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants