SamDecrock / node-http-ntlm

Node.js module to authenticate using HTTP NTLM
MIT License
192 stars 89 forks source link

Refuses to work if domain and/or workstation is "" in node 6.4.0 #46

Closed Suppen closed 7 years ago

Suppen commented 8 years ago

I upgraded from node 6.3.1 to 6.4.0, and my application broke. The specific line on which it broke is 97 in ntlm.js

The problem is that the variable pos, holding the buffer offset is 40, which is also the length of the buffer. When trying to buf.write the workstation and domain names, both "" (empty string), the method throws a RangeError because the offset points to the byte after the end of the array.

My temporary fix is to comment out the lines writing workstation and domain to the buffer, but that is not a general solution

Suppen commented 8 years ago

This works again in Node 6.5.0

SamDecrock commented 7 years ago

Let me know if it's fixed.

Suppen commented 7 years ago

Not using Node 6.4.0 anymore, but judging by your commit, it should be fixed

SamDecrock commented 7 years ago

All right, good :)