C#

C#

Made by DeepSource

Consider using Uri.EscapeDataString() instead of Uri.EscapeUriString() CS-S1009

Security
Critical
Autofix a08 cwe-502 sans top 25 owasp top 10

The Uri.EscapeUriString() method converts a URI string into its escaped representation. However, this API is obsolete as it can corrupt URIs in some cases. The safer alternative is Uri.EscapeDataString().

Bad Practice

var escaped = Uri.EscapeUriString(uri);

Recommended

var escaped = Uri.EscapeDataString(uri);

Reference