diff --git a/lib/ntlm/http.rb b/lib/ntlm/http.rb index bfa1a04..09ddb77 100644 --- a/lib/ntlm/http.rb +++ b/lib/ntlm/http.rb @@ -30,14 +30,14 @@ def request(req, body = nil, &block) end # Negotiation - req['authorization'] = 'NTLM ' + NTLM.negotiate.to_base64 + req['authorization'] = 'NTLM ' + ::NTLM.negotiate.to_base64 res = request_without_ntlm_auth(req, body) challenge = res['www-authenticate'][/NTLM (.*)/, 1].unpack('m').first rescue nil if challenge && res.code == '401' # Authentication user, domain, password = req.ntlm_auth_params - req['authorization'] = 'NTLM ' + NTLM.authenticate(challenge, user, domain, password).to_base64 + req['authorization'] = 'NTLM ' + ::NTLM.authenticate(challenge, user, domain, password).to_base64 req.body_stream.rewind if req.body_stream request_without_ntlm_auth(req, body, &block) # We must re-use the connection. else diff --git a/lib/ntlm/imap.rb b/lib/ntlm/imap.rb index a8fe550..23a46e3 100644 --- a/lib/ntlm/imap.rb +++ b/lib/ntlm/imap.rb @@ -24,9 +24,9 @@ def initialize(user, domain, password) def process(data) case (@state += 1) when 1 - NTLM.negotiate.to_s + ::NTLM.negotiate.to_s when 2 - NTLM.authenticate(data, @user, @domain, @password).to_s + ::NTLM.authenticate(data, @user, @domain, @password).to_s end end end # NTLMAuthenticator