Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Invalid parsing/encoding of the URI userinfo #20

Open
@cricog

Description

@cricog

Some characters are not properly parsed from string, and encoded when converted to string, in the userinfo. For example, the "@" char should be represented in strings as "%40" (but passed as "@" to the Authorization header for HTTP), and userinfo containing percent-encoded chars should be decoded/encoded the right way.

It seems that the following comment about "@" in https://github.com/zendframework/zend-uri/blob/master/src/Uri.php#L297 is wrong:

                // The userInfo can also contain '@' symbols; split $authority
                // into segments, and set it to the last segment.

form my understanding of the RFC-3986:

    userinfo    = *( unreserved / pct-encoded / sub-delims / ":" )
    unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"
    pct-encoded = "%" HEXDIG HEXDIG
    sub-delims  = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions