Skip to content

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

@jcrossley3

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions