Fixed loose check for headers.

Now search for lower-case header variable and convert to boolean before
sending back to caller.
This commit is contained in:
2020-09-07 17:49:33 +02:00
parent 5cfec8bb9d
commit 8c0a002020

View File

@@ -31,8 +31,8 @@ const allRequestedWines = () => {
return fetch(url.href)
.then(resp => {
const isAdmin = resp.headers.get("Vinlottis-Admin") || false;
return Promise.all([resp.json(), isAdmin]);
const isAdmin = resp.headers.get("vinlottis-admin") || false;
return Promise.all([resp.json(), Boolean(isAdmin)]);
});
};