UNPKG

893 BTypeScriptView Raw
1/**
2 * Answers "does the request-path path-match a given cookie-path?" as per {@link https://www.rfc-editor.org/rfc/rfc6265.html#section-5.1.4 | RFC6265 Section 5.1.4}.
3 * This is essentially a prefix-match where cookiePath is a prefix of reqPath.
4 *
5 * @remarks
6 * A request-path path-matches a given cookie-path if at least one of
7 * the following conditions holds:
8 *
9 * - The cookie-path and the request-path are identical.
10 * - The cookie-path is a prefix of the request-path, and the last character of the cookie-path is %x2F ("/").
11 * - The cookie-path is a prefix of the request-path, and the first character of the request-path that is not included in the cookie-path is a %x2F ("/") character.
12 *
13 * @param reqPath - the path of the request
14 * @param cookiePath - the path of the cookie
15 * @public
16 */
17export declare function pathMatch(reqPath: string, cookiePath: string): boolean;