Skip to content

Should '+' be encoded in the version component? #31

Description

@jcrossley3

I interpret the spec to require that + should be percent-encoded.

I modified one of the unit tests slightly and was surprised this assertion failed

    let canonical = GenericPurl::<String>::from_str("pkg:generic/name@a%2bx")
        .expect("Canonical PURL should parse");
    assert_eq!(
        "pkg:generic/name@a%2bx",
        canonical.to_string(),
        "Parsed canonical PURL should format as the same string",
    );
assertion `left == right` failed: Parsed canonical PURL should format as the same string
  left: "pkg:generic/name@a%2bx"
 right: "pkg:generic/name@a+x"

If this isn't a bug, can you clarify my [mis]understanding of the spec, please? Thanks!

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