From 81e724eaa2a59f56f18d571e9425ba2ce85f8456 Mon Sep 17 00:00:00 2001 From: Matt Sidor Date: Mon, 28 Nov 2022 21:15:45 -0800 Subject: [PATCH] fix(fallback): check for 403 http status code for fallback image #28 --- src/auro-avatar.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/auro-avatar.js b/src/auro-avatar.js index 640cac5..639553e 100644 --- a/src/auro-avatar.js +++ b/src/auro-avatar.js @@ -134,7 +134,12 @@ class AuroAvatar extends LitElement { // when airport `code` attribute is declared url = `https://resource.alaskaair.net/-/media/Images/common-assets/destinations/${this.imageSize(this.type)}/${this.code}`; - const errorCodes = [404]; // eslint-disable-line no-magic-numbers + /* eslint-disable no-magic-numbers */ + const errorCodes = [ + 403, + 404 + ]; + /* eslint-enable no-magic-numbers */ if (errorCodes.includes(this.urlStatus(url))) { url = `https://resource.alaskaair.net/-/media/Images/common-assets/destinations/${this.imageSize(this.type)}/partner`;