Skip to content

Commit

Permalink
fix(fallback): check for 403 http status code for fallback image #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Sidor authored and blackfalcon committed Nov 30, 2022
1 parent 03435d2 commit 81e724e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/auro-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit 81e724e

Please sign in to comment.