From: merch-redmine@... Date: 2021-03-04T22:19:33+00:00 Subject: [ruby-dev:51030] [Ruby master Feature#9045] URIに含まれるエンコードされたID/パスワードがデコードされない Issue #9045 has been updated by jeremyevans0 (Jeremy Evans). ruby -v deleted (1.9.3p448) Tracker changed from Bug to Feature This is a request relating to #user and #password for URIs returning actual (encoded) values and not decoded values. The fact that #user and #password return the actual and not decoded values is not a bug, and changing the behavior of the methods would break backwards compatibility. It seems simplest to address this need by adding #decoded_user and #decoded_password methods. I've submitted a PR which does that: https://github.com/ruby/uri/pull/17 ---------------------------------------- Feature #9045: URIに含まれるエンコードされたID/パスワードがデコードされない https://bugs.ruby-lang.org/issues/9045#change-90739 * Author: vmi (Motonori IWAMURO) * Status: Assigned * Priority: Normal * Assignee: akira (akira yamada) ---------------------------------------- URI(プロキシ設定も含む)にID/パスワードを含めるとき、IDやパスワードに「@」や「:」等がある場合はURIエンコードする必要がありますが、uriライブラリがこれをデコードしてくれません。 そのため、認証プロキシでIDに「@」が含まれていると認証に失敗するなどの問題が生じます。 ソースを追っかけて uri/generic.rb の問題だろうというところまでは調べたのですが、user/passwordを取り扱う部分がたくさんあるので、何処でエンコード/デコードすればいいのかよくわからない状況です。 とりあえず手元ではdef user と def password に URI.decode_www_form_component を突っ込んでますが、たぶんこれでは片手落ちと思われます。 -- https://bugs.ruby-lang.org/