mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-15 21:16:17 +02:00
Always use remote url for discord rpc image (#2009)
* add option to force remote url for api calls * force remote url for discord rpc image
This commit is contained in:
@@ -428,12 +428,13 @@ const silentlyTransformResponse = (data: any) => {
|
||||
};
|
||||
|
||||
export const ssApiClient = (args: {
|
||||
forceRemoteUrl?: boolean;
|
||||
server: null | ServerListItemWithCredential;
|
||||
signal?: AbortSignal;
|
||||
silent?: boolean;
|
||||
url?: string;
|
||||
}) => {
|
||||
const { server, signal, silent, url } = args;
|
||||
const { forceRemoteUrl, server, signal, silent, url } = args;
|
||||
|
||||
return initClient(contract, {
|
||||
api: async ({ body, headers, method, path, rawQuery }) => {
|
||||
@@ -443,7 +444,7 @@ export const ssApiClient = (args: {
|
||||
const { params, path: api } = parsePath(path);
|
||||
|
||||
if (server) {
|
||||
const serverUrl = getServerUrl(server);
|
||||
const serverUrl = getServerUrl(server, forceRemoteUrl);
|
||||
baseUrl = serverUrl ? `${serverUrl}/rest` : undefined;
|
||||
const token = server.credential;
|
||||
const params = token.split(/&?\w=/gm);
|
||||
|
||||
Reference in New Issue
Block a user