diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-05-03 22:48:41 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2024-09-29 21:00:26 +0900 |
| commit | f5d9d9b5f8bce3c1f7003221e02877fcf7e9b727 (patch) | |
| tree | 2f0773a6fd937cb50620c39af3fb0cb0a94e0589 | |
| parent | 25eb9bded8bd60dcf186f393acf84a4e623b60e1 (diff) | |
win32/sspi: Use `start_with?` to see prefix
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11722
| -rw-r--r-- | ext/win32/lib/win32/sspi.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/win32/lib/win32/sspi.rb b/ext/win32/lib/win32/sspi.rb index b4bddc67b3..f382f3cf50 100644 --- a/ext/win32/lib/win32/sspi.rb +++ b/ext/win32/lib/win32/sspi.rb @@ -283,12 +283,12 @@ module Win32 # Nil token OK, just set it to empty string 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. - token = token.split(" ").last + token = token.split(" ", 2).last end - if token.include? B64_TOKEN_PREFIX + if token.start_with? B64_TOKEN_PREFIX # indicates base64 encoded token token = token.strip.unpack1("m") end @@ -309,7 +309,7 @@ module Win32 clean_up unless @cleaned_up end - private + private def clean_up # free structures allocated |
