Should encode names in provider API url
This commit is contained in:
parent
2552ccbe0b
commit
4a8d7d70cb
1 changed files with 2 additions and 2 deletions
|
@ -61,11 +61,11 @@ export async function fetchProviderProxies(config: ClashAPIConfig) {
|
||||||
export async function updateProviderByName(config: ClashAPIConfig, name: string) {
|
export async function updateProviderByName(config: ClashAPIConfig, name: string) {
|
||||||
const { url, init } = getURLAndInit(config);
|
const { url, init } = getURLAndInit(config);
|
||||||
const options = { ...init, method: 'PUT' };
|
const options = { ...init, method: 'PUT' };
|
||||||
return await fetch(url + '/providers/proxies/' + name, options);
|
return await fetch(url + '/providers/proxies/' + encodeURIComponent(name), options);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function healthcheckProviderByName(config: ClashAPIConfig, name: string) {
|
export async function healthcheckProviderByName(config: ClashAPIConfig, name: string) {
|
||||||
const { url, init } = getURLAndInit(config);
|
const { url, init } = getURLAndInit(config);
|
||||||
const options = { ...init, method: 'GET' };
|
const options = { ...init, method: 'GET' };
|
||||||
return await fetch(url + '/providers/proxies/' + name + '/healthcheck', options);
|
return await fetch(url + '/providers/proxies/' + encodeURIComponent(name) + '/healthcheck', options);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue