Merge pull request #627 from peteyus/issue/626/add-headers-on-file-upload

add API headers on upload call
This commit is contained in:
Jan Prochazka 2023-09-28 09:33:27 +02:00 committed by GitHub
commit 1c5a90226e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import { extensions } from '../stores';
import { get } from 'svelte/store';
import { canOpenByElectron, openElectronFileCore } from './openElectronFile';
import getElectron from './getElectron';
import resolveApi from './resolveApi';
import resolveApi, { resolveApiHeaders } from './resolveApi';
import { findFileFormat } from '../plugins/fileformats';
import { showModal } from '../modals/modalTools';
import ImportExportModal from '../modals/ImportExportModal.svelte';
@ -46,6 +46,7 @@ export default function uploadFiles(files) {
const fetchOptions = {
method: 'POST',
body: formData,
headers: resolveApiHeaders(),
};
const apiBase = resolveApi();