savonrb/httpi — pull request #105 by ryanhattam (2013-12-16 08:44:25+00:00)
Title: make compatible with rubyntlm 0.3

httpi has 'rubyntlm', '~> 0.3.2' in its gem file, but there are two problems with using that version.

1) httpi is encoding the domain (using encode_utf16le) if a domain is passed into for ntlm authentication. When its passed to rubyntlm, it too encodes this parameter, using the same method. This double encoding does not work when passed in for authentication to a server, only the first letter is decoded. The username and password are not encoded by httpi which is correct. I simply stopped httpi from encoding the domain, as it doesn't need to.

2) httpi is attempting to pass in the 'workstation' by passing it in to the first parameter of rubyntlm's response method (arg), when its actually looking for it in the second parameter (opt). Luckily rubyntlm is also doing a workstation lookup, using the same Socket method, so the one in httpi is pointless. The comment in the httpi code indicates it was attempting to set it because rubyntlm wasn't doing it. Due to this comment, and it setting it in the wrong place it must have been referring to a previous version.

I believe this fixes the following issue: https://github.com/savonrb/httpi/issues/102

Tests pass with this change.

Thanks