From 7798854b2b7c03619c43f614095e5efd583a2c8e Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Fri, 4 Nov 2022 00:01:34 +0100 Subject: [PATCH] webapp: Change authHeader to return Headers object instead of Record --- webapp/src/utils/authentication.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/src/utils/authentication.ts b/webapp/src/utils/authentication.ts index fe145da..c6590b0 100644 --- a/webapp/src/utils/authentication.ts +++ b/webapp/src/utils/authentication.ts @@ -1,11 +1,11 @@ -export function authHeader(): HeadersInit { +export function authHeader(): Headers { // return authorization header with basic auth credentials let user = JSON.parse(localStorage.getItem('user') || ""); if (user && user.authdata) { - return { 'Authorization': 'Basic ' + user.authdata }; + return new Headers({ 'Authorization': 'Basic ' + user.authdata }) } else { - return {}; + return new Headers(); } }