Project

General

Profile

Actions

Feature #19915

open

URI::HTTP.build accepts user: and password: keyboard arguments, but do not populate #user or #password

Added by postmodern (Hal Brodigan) 7 months ago. Updated 7 months ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:114983]

Description

I noticed that URI::HTTP.build accepts the user: and password: keyword arguments, but does not actually set the user or password attributes of the built URI object. It does however correctly accept a userinfo: keyword argument.

Steps To Reproduce

uri = URI::HTTP.build(user: 'bob', password: 'secret', host: 'example.com', path: '/foo')
uri.user
uri.password
uri.to_s

Expected Results

uri.user
# => "bob"
uri.password
# => "secret"
uri.to_s
# => "http://bob:secret@example.com/foo"

Actual Results

uri.user
# => nil
uri.password
# => nil
uri.to_s
# => "http://example.com/foo"
Actions

Also available in: Atom PDF

Like0
Like0Like0