Skip to content

Commit

Permalink
Specify full path to NTLM module referred inside the NET module.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaSamodurov committed Oct 22, 2015
1 parent 2aa4aa7 commit 538ea6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ntlm/http.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/ntlm/imap.rb
Expand Up @@ -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
Expand Down

0 comments on commit 538ea6b

Please sign in to comment.