Skip to main content

ash_normalize_binding

Function ash_normalize_binding 

Source
pub fn ash_normalize_binding(
    method: &str,
    path: &str,
    query: &str,
) -> Result<String, JsValue>
Expand description

Normalize a binding string to canonical form (v2.3.2+ format).

Bindings are in the format: “METHOD|PATH|CANONICAL_QUERY”

§Normalization Rules

  • Method uppercased
  • Path starts with /
  • Duplicate slashes collapsed
  • Trailing slash removed
  • Query string canonicalized
  • Parts joined with | (pipe)

@param method - HTTP method (GET, POST, etc.) @param path - URL path @param query - Query string (empty string if none) @returns Canonical binding string (METHOD|PATH|QUERY) @throws Error if method is empty or path doesn’t start with /