Skip to content

Commit

Permalink
feat: added cors to api server
Browse files Browse the repository at this point in the history
  • Loading branch information
Venipa committed May 16, 2024
1 parent 4c81bbb commit accc528
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ytmdesktop2",
"version": "0.12.9",
"version": "0.12.10",
"private": false,
"author": "Venipa <[email protected]>",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/api/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { app, getWss } = expressWs(createApp());
let appConfig: SettingsStore;
const log = logger.child("api-server");
const router = Router() as expressWs.Router;
const whitelist = ['http://localhost', 'https://localhost']
const whitelist = ['http://localhost', 'https://localhost', 'file://']
app.use(cors({
origin: function (origin, callback) {
if (whitelist.find(x => origin.indexOf(x) === 0)) callback(null, true); // allow any localhost
Expand Down

0 comments on commit accc528

Please sign in to comment.