mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Ignore CORS & SSL (#23)
* Add toggle to ignore CORS * Add option to ignore SSL
This commit is contained in:
parent
8eec6b6b8a
commit
c878e36015
5 changed files with 83 additions and 20 deletions
|
|
@ -78,11 +78,15 @@ import { ServerListItem, ServerType } from '/@/renderer/types';
|
|||
import { parseSearchParams } from '/@/renderer/utils';
|
||||
import packageJson from '../../../package.json';
|
||||
|
||||
const IGNORE_CORS = localStorage.getItem('IGNORE_CORS') === 'true';
|
||||
|
||||
const getCommaDelimitedString = (value: string[]) => {
|
||||
return value.join(',');
|
||||
};
|
||||
|
||||
const api = ky.create({});
|
||||
const api = ky.create({
|
||||
mode: IGNORE_CORS ? 'cors' : undefined,
|
||||
});
|
||||
|
||||
const authenticate = async (
|
||||
url: string,
|
||||
|
|
|
|||
|
|
@ -88,6 +88,8 @@ import { ServerListItem, ServerType } from '/@/renderer/types';
|
|||
import { parseSearchParams } from '/@/renderer/utils';
|
||||
import { subsonicApi } from '/@/renderer/api/subsonic.api';
|
||||
|
||||
const IGNORE_CORS = localStorage.getItem('IGNORE_CORS') === 'true';
|
||||
|
||||
const api = ky.create({
|
||||
hooks: {
|
||||
afterResponse: [
|
||||
|
|
@ -122,6 +124,7 @@ const api = ky.create({
|
|||
},
|
||||
],
|
||||
},
|
||||
mode: IGNORE_CORS ? 'cors' : undefined,
|
||||
});
|
||||
|
||||
const authenticate = async (
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ import {
|
|||
import { toast } from '/@/renderer/components/toast';
|
||||
import { nanoid } from 'nanoid/non-secure';
|
||||
|
||||
const IGNORE_CORS = localStorage.getItem('IGNORE_CORS') === 'true';
|
||||
|
||||
const getCoverArtUrl = (args: {
|
||||
baseUrl: string;
|
||||
coverArtId: string;
|
||||
|
|
@ -93,6 +95,7 @@ const api = ky.create({
|
|||
},
|
||||
],
|
||||
},
|
||||
mode: IGNORE_CORS ? 'cors' : undefined,
|
||||
});
|
||||
|
||||
const getDefaultParams = (server: ServerListItem | null) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue