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:
		| @@ -31,8 +31,8 @@ const allRequestedWines = () => { | |||||||
|  |  | ||||||
|   return fetch(url.href) |   return fetch(url.href) | ||||||
|     .then(resp => { |     .then(resp => { | ||||||
|       const isAdmin = resp.headers.get("Vinlottis-Admin") || false; |       const isAdmin = resp.headers.get("vinlottis-admin") || false; | ||||||
|       return Promise.all([resp.json(), isAdmin]); |       return Promise.all([resp.json(), Boolean(isAdmin)]); | ||||||
|     }); |     }); | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user