googleapis-common
Version:
A common tooling library used by the googleapis npm module. You probably don't want to use this directly.
10 lines (9 loc) • 522 B
TypeScript
/**
* Validates path parameters against traversal attacks ('.' and '..') and encodes
* multi-segment parameters in params so that reserved characters (query params, fragments, etc.)
* cannot be injected into the path. Modifies params in-place.
*
* @param urlTemplate URL template associated with the request (e.g. url, mediaUrl)
* @param params Request parameters dictionary (modified in-place)
*/
export declare function validateAndEncodeParams(urlTemplate: string | undefined, params: Record<string, any>): void;