From ef0e47d7f5dcafd0cb96d8c561cd76a11e02291c Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Mon, 10 Mar 2025 14:33:58 +0700 Subject: [PATCH] Update carrack.js so it can put Authentication --- static/js/carrack.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/carrack.js b/static/js/carrack.js index 7752eea..db11e92 100644 --- a/static/js/carrack.js +++ b/static/js/carrack.js @@ -1,7 +1,8 @@ -function sendHttpRequest(url, method, data, callback, contentType = "multipart/form-data") { +function sendHttpRequest(url, method, data, callback, contentType = "multipart/form-data", authorization = "") { var xhr = new XMLHttpRequest(); xhr.open(method, url, true); xhr.setRequestHeader("Content-Type", contentType); + xhr.setRequestHeader("Authorization", authorization); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) {