From 52f536a6549e918de1a29545c190eb70c488be76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Thu, 26 Mar 2020 17:44:44 +0100 Subject: [PATCH] Fix RequestHeader --- static/js/getTextFromFile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/getTextFromFile.js b/static/js/getTextFromFile.js index c0c0dda2..7fff353c 100644 --- a/static/js/getTextFromFile.js +++ b/static/js/getTextFromFile.js @@ -1,8 +1,10 @@ async function getTextFromFileUrlAsync(url) { return new Promise(function (resolve, reject) { var req = new XMLHttpRequest(); - req.setRequestHeader("Cache-Control: no-cache, no-store, must-revalidate") req.open("GET",url, true); + for (const item of ["no-cache","no-store","must-revalidate"]) { + req.setRequestHeader("Cache-Control",item) + } req.onreadystatechange = function() { if (req.readyState == 4) { if (req.status == 200) {//when a good response is given do this