Skip to content

Fix SYSLIB0013: use Uri.EscapeDataString for URL path segments#2016

Merged
matt-richardson merged 1 commit into
mainfrom
fix/syslib0013-escape-data-string
Jun 15, 2026
Merged

Fix SYSLIB0013: use Uri.EscapeDataString for URL path segments#2016
matt-richardson merged 1 commit into
mainfrom
fix/syslib0013-escape-data-string

Conversation

@matt-richardson

Copy link
Copy Markdown
Contributor

What

Replaces the two obsolete Uri.EscapeUriString calls in GitHubPackageDownloader with Uri.EscapeDataString when building the GitHub tags API URL.

Why

Uri.EscapeUriString is obsolete (SYSLIB0013) precisely because it under-escapes — it leaves reserved characters (/, ?, #, &, etc.) unescaped. The owner and repository values are interpolated as individual URL path segments:

$"repos/{owner}/{repository}/tags?..."

Uri.EscapeDataString is the documented correct replacement for URI components. This also fixes a latent bug: an owner/repo name containing a reserved character would previously corrupt the constructed URL.

Impact

  • Clears the SYSLIB0013 warning category (4 warnings counting both TFMs).
  • Behaviour-positive: correct escaping of path-segment values; no change for names that contain only unreserved characters.
  • Calamari.Shared builds clean.

🤖 Generated with Claude Code

Uri.EscapeUriString is obsolete because it under-escapes — it leaves
reserved characters (/, ?, #, etc.) unescaped, which can corrupt the
request URL. The GitHub owner and repository values are individual URL
path segments, so Uri.EscapeDataString is the correct replacement and
also fixes the latent bug where a name containing a reserved character
would break the constructed URL.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@matt-richardson matt-richardson requested a review from Jtango18 June 15, 2026 05:11
@matt-richardson matt-richardson marked this pull request as ready for review June 15, 2026 05:11
@matt-richardson matt-richardson enabled auto-merge (squash) June 15, 2026 05:16
@matt-richardson matt-richardson merged commit ccebed3 into main Jun 15, 2026
35 checks passed
@matt-richardson matt-richardson deleted the fix/syslib0013-escape-data-string branch June 15, 2026 05:58
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