Skip to content

regression in 1.0.4: setting host clears the user #184

@HoneyryderChuck

Description

@HoneyryderChuck

I have some code relying on the following logic:

require "uri"
uri = URI("socks4://user:@socksproxy:8080")
uri.user #=> "user"
uri.host = Resolv.getaddress("socksproxy") #=> "127.0.0.1"
uri.user #=> used to be "user", now it's nil

I understand that this was all done as a fix for a CVE to not expose passwords, but if no password is set, this resetting credentials just feels a bit odd. Also, the CVE seems more about preventing when merging two uris and leaking credentials from one to the other, and this patch does way more than that, i.e. resetting state when mutating. I don't think that they're the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions