Skip to content

Purl Encoding/Decoding bug #29

@thepl4n

Description

@thepl4n

As per purl specification, purl URL should conform to the URL definitions or specifications of rfc3986. Current implementation uses WebUtility.UrlEncode() and WebUtility.UrlDecode() which does not follow rfc3986 specification.
Example - 

PackageURL purl = new PackageURL("docker", "ruby advisory db check");
Console.WriteLine(purl.ToString());
// This code produces the following output:
// pkg:docker/ruby+advisory+db+check

As here we can see the WebUtility.UrlEncode() encodes spaces as + but as per rfc3986 it should be encoded as %20. If we look other implementations of purl (JAVA, JS) those implementations encode spaces as %20. There's incompatibility with other implementations when they decode purl encoded by this dotnet implementation.

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