зеркало из https://github.com/github/ruby.git
win32/sspi: Use `start_with?` to see prefix
This commit is contained in:
Родитель
25eb9bded8
Коммит
f5d9d9b5f8
|
@ -283,12 +283,12 @@ module Win32
|
||||||
# Nil token OK, just set it to empty string
|
# Nil token OK, just set it to empty string
|
||||||
token = "" if token.nil?
|
token = "" if token.nil?
|
||||||
|
|
||||||
if token.include? "Negotiate"
|
if token.start_with? "Negotiate"
|
||||||
# If the Negotiate prefix is passed in, assume we are seeing "Negotiate <token>" and get the token.
|
# If the Negotiate prefix is passed in, assume we are seeing "Negotiate <token>" and get the token.
|
||||||
token = token.split(" ").last
|
token = token.split(" ", 2).last
|
||||||
end
|
end
|
||||||
|
|
||||||
if token.include? B64_TOKEN_PREFIX
|
if token.start_with? B64_TOKEN_PREFIX
|
||||||
# indicates base64 encoded token
|
# indicates base64 encoded token
|
||||||
token = token.strip.unpack1("m")
|
token = token.strip.unpack1("m")
|
||||||
end
|
end
|
||||||
|
@ -309,7 +309,7 @@ module Win32
|
||||||
clean_up unless @cleaned_up
|
clean_up unless @cleaned_up
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def clean_up
|
def clean_up
|
||||||
# free structures allocated
|
# free structures allocated
|
||||||
|
|
Загрузка…
Ссылка в новой задаче