Skip to content

Pluses and spaces#14

Merged
matt-phylum merged 3 commits intomainfrom
matt/plus-space
Nov 20, 2023
Merged

Pluses and spaces#14
matt-phylum merged 3 commits intomainfrom
matt/plus-space

Conversation

@matt-phylum
Copy link
Collaborator

Overview

This PR escapes the plus sign character when emitting qualifiers into a PURL string. This avoids problems when parsing PURLs using packageurl-dotnet, packageurl-go, packageurl-java, packageurl-js, or packageurl-ruby, all of which incorrectly convert plus signs in qualifiers into spaces on read as if the qualifiers were x-www-form-urlencoded.

This PR does not fix the compatibility problem when parsing a PURL produced by packageurl-dotnet, packageurl-go, or packageurl-ruby, which incorrectly convert spaces to plus signs in qualifiers on write for the same reason. We can't tell what implementation generated the PURL so we can't tell whether it correctly implements the qualifier section of the spec or not.

This PR also does not fix the problem where packageurl-dotnet, packageurl-java, and packageurl-ruby incorrectly convert plus signs in other parts of the purl into spaces on read, or the problem where packageurl-dotnet and packageurl-ruby incorrectly convert spaces in other parts of the purl into plus signs on write. This is pretty clearly an implementation error because even if the qualifiers were x-www-form-urlencoded, the rest of the PURL is definitely not x-www-form-urlencoded.

Checklist

  • Does this PR have an associated issue?
  • Have you ensured that you have met the expected acceptance criteria?
  • Have you created sufficient tests?

Issue

Ref #11

@matt-phylum matt-phylum merged commit c71730c into main Nov 20, 2023
@matt-phylum matt-phylum deleted the matt/plus-space branch November 20, 2023 13:35
@matt-phylum matt-phylum mentioned this pull request Apr 26, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants