diff --git a/lib/protocol/http/header/authorization.rb b/lib/protocol/http/header/authorization.rb index 1ea9018..a4d9eea 100644 --- a/lib/protocol/http/header/authorization.rb +++ b/lib/protocol/http/header/authorization.rb @@ -3,8 +3,6 @@ # Released under the MIT License. # Copyright, 2019-2023, by Samuel Williams. -require 'base64' - module Protocol module HTTP module Header @@ -21,10 +19,10 @@ def credentials end def self.basic(username, password) - encoded = "#{username}:#{password}" + strict_base64_encoded = ["#{username}:#{password}"].pack('m0') self.new( - "Basic #{Base64.strict_encode64(encoded)}" + "Basic #{strict_base64_encoded}" ) end end diff --git a/protocol-http.gemspec b/protocol-http.gemspec index 5986656..97e61a8 100644 --- a/protocol-http.gemspec +++ b/protocol-http.gemspec @@ -22,6 +22,4 @@ Gem::Specification.new do |spec| spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__) spec.required_ruby_version = ">= 3.0" - - spec.add_dependency "base64" end