Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
URI::Generic#escape_userpass
(::String v) -> ::String
escape_userpass(v)
lib/uri/generic.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/uri/generic.rb, line 551
def escape_userpass(v)
parser.escape(v, /[@:\/]/o) # RFC 1738 section 3.1 #/
end
Escapes ‘user:password’ v based on RFC 1738 section 3.1.