Percent-encode URL path when reporting spam
This commit is contained in:
parent
6ddb12cd99
commit
7f0ed2599d
3 changed files with 27 additions and 3 deletions
|
@ -33,3 +33,9 @@ function cloneUrl(url: Readonly<URL>): URL {
|
|||
function stringifySearchParamValue(value: unknown): string {
|
||||
return value == null ? '' : String(value);
|
||||
}
|
||||
|
||||
export function urlPathFromComponents(
|
||||
components: ReadonlyArray<string>
|
||||
): string {
|
||||
return `/${components.filter(Boolean).map(encodeURIComponent).join('/')}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue