Skip to content

com.alibaba.dubbo.common.URL不能使用邮箱作为用户名 #1470

Closed

Description

@CandleFlower

com.alibaba.dubbo.common.URL.valueof()中如果用户名或密码中包含@字段,导致解析错误
i = url.indexOf("@");需要将此字段改为i = url.lastIndexOf("@");

Activity

  1. leiwei2094 commented on Mar 26, 2018

    @leiwei2094
    Contributor

    We will improve the URL interpreting logic, thanks a lot.

  2. ralf0131 commented on Apr 28, 2018

    @ralf0131
    Contributor

    Hi, thanks for reporting, could you please send a pull request to fix it?

  3. markt-asf commented on May 21, 2018

    @markt-asf

    I'm not convinced that this bug report is valid.
    From RFC 3986
    authority = [ userinfo "@" ] host [ ":" port ]
    userinfo = ( unreserved / pct-encoded / sub-delims / ":" )
    unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
    sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "
    " / "+" / "," / ";" / "="

    The '@' character is not a valid character for the userinfo. If use of a '@' is required then it would need to be %nn encoded. Multiple '@' before those host looks to be invalid and should probably be rejected.

  4. beiwei30 commented on May 21, 2018

    @beiwei30
    Member

    I agree with Mark's opinion. @ is used as seperator for userinfo. I think we could close this issue directly.

  5. chickenlj commented on May 22, 2018

    @chickenlj
    Contributor

    We can refer what java.lang.URL does.
    I think change to lastIndexOf() brings no harm, there's also no need to add error promotion. But we should remove the '@' use cases in UT.

  6. added a commit that references this issue on Sep 9, 2019
    8d11dba
  7. added a commit that references this issue on Sep 10, 2019
    116c9c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions