lib/net/ntlm.rb in rubyntlm-0.3.3 vs lib/net/ntlm.rb in rubyntlm-0.3.4
- old
+ new
@@ -52,11 +52,11 @@
module NTLM
# @private
module VERSION
MAJOR = 0
MINOR = 3
- TINY = 3
+ TINY = 4
STRING = [MAJOR, MINOR, TINY].join('.')
end
SSP_SIGN = "NTLMSSP\0"
BLOB_SIGN = 0x00000101
@@ -131,10 +131,10 @@
# you can either marshal the encodings elsewhere of simply know that each time you call encode_utf16le
# the function will convert the string bytes to UTF-16LE and note the encoding as UTF-8 so that byte
# concatination works seamlessly.
def self.encode_utf16le(str)
str = str.force_encoding('UTF-8') if [::Encoding::ASCII_8BIT,::Encoding::US_ASCII].include?(str.encoding)
- str.force_encoding('UTF-8').encode(Encoding::UTF_16LE, Encoding::UTF_8).force_encoding('UTF-8')
+ str.dup.force_encoding('UTF-8').encode(Encoding::UTF_16LE, Encoding::UTF_8).force_encoding('UTF-8')
end
end
end
class << self