mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-18 15:25:21 +00:00
fix
This commit is contained in:
parent
58ba6e8c1a
commit
544cdb1031
1 changed files with 9 additions and 1 deletions
|
|
@ -62,10 +62,18 @@ export const createPathWithQueryParams = (path: string, ...queryParams: [string,
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryString = queryParams.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value ?? '')}`).join('&');
|
const queryString = queryParams.map(([key, value]) => `${encodeURIComponent(key)}=${encodeRFC3986URIComponent(value ?? '')}`).join('&');
|
||||||
return `${path}?${queryString}`;
|
return `${path}?${queryString}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent#encoding_for_rfc3986
|
||||||
|
const encodeRFC3986URIComponent = (str: string) => {
|
||||||
|
return encodeURIComponent(str).replace(
|
||||||
|
/[!'()*]/g,
|
||||||
|
(c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
type AuthProviderInfo = {
|
type AuthProviderInfo = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue