AssetPath class

Namespace Runic.Assets · Runic.Assets 0.7.0-preview.5

public static class AssetPath

Validates application-relative asset paths at every trust boundary.

Methods

Normalize

public static string Normalize(string value)

Returns the canonical slash-separated form of a safe application-relative path.

Exceptions

ArgumentException

The path is empty, rooted, ambiguous, or contains unsupported characters.

TryNormalize

public static bool TryNormalize(string? value, out string? normalized)

Returns whether a path is a safe application-relative asset path and, if so, its canonical slash-separated form. Use this for untrusted request paths; it never throws.