lib/httpx/plugins/basic_authentication.rb in httpx-0.2.0 vs lib/httpx/plugins/basic_authentication.rb in httpx-0.2.1

- old
+ new

@@ -8,10 +8,10 @@ klass.plugin(:authentication) end module InstanceMethods def basic_authentication(user, password) - authentication("Basic #{Base64.strict_encode64("#{user}:#{password}")}") + authentication("Basic #{Base64.strict_encode64("#{URI.escape(user)}:#{URI.escape(password)}")}") end alias_method :basic_auth, :basic_authentication end end register_plugin :basic_authentication, BasicAuthentication