From a0321d67e4ebcdfcaa6c4a5a5d3e1b39fa8eaa35 Mon Sep 17 00:00:00 2001 From: huangjx Date: Tue, 31 May 2022 11:53:08 +0800 Subject: [PATCH] fix #65 --- src/lib/http.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/http.ts b/src/lib/http.ts index 71d688e..3d82364 100644 --- a/src/lib/http.ts +++ b/src/lib/http.ts @@ -147,7 +147,10 @@ export const Http = class { } upload(file: File) { const fd = new FormData(); + this.client = new XMLHttpRequest(); this.client.open(this.method, this.url, true); + this.setHeader('requesttoken', this.getToken()) + this.setHeader('OCS-APIREQUEST', 'true') let callback = this.handler; this.client.onload = () => { if (typeof callback === 'function')