[ruby/open-uri] Don't use Base64 library

https://github.com/ruby/open-uri/commit/c8c0452d53
This commit is contained in:
Hiroshi SHIBATA 2024-07-08 13:39:54 +09:00 committed by git
parent bf898057b4
commit dcc8e54234

View File

@ -1,5 +1,4 @@
require 'socket'
require 'base64'
class SimpleHTTPServer
def initialize(bind_addr, port, log)
@ -79,7 +78,7 @@ class SimpleHTTPServer
return unless auth && auth.start_with?('Basic ')
encoded_credentials = auth.split(' ', 2).last
decoded_credentials = Base64.decode64(encoded_credentials)
decoded_credentials = [encoded_credentials].pack("m")
@username, @password = decoded_credentials.split(':', 2)
end
end