Skip to content

Commit

Permalink
fix: resolve CodeQL error
Browse files Browse the repository at this point in the history
  • Loading branch information
gauthier-th committed Oct 16, 2024
1 parent 7ff242d commit 7429297
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/routes/avatarproxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ router.get('/*', async (req, res) => {
let imagePath = '';
try {
const jellyfinAvatar = req.url.match(
/.*?(\/Users\/\w+\/Images\/Primary\/?\?tag=\w+&quality=90)$/
/(\/Users\/\w+\/Images\/Primary\/?\?tag=\w+&quality=90)$/
)?.[1];
if (!jellyfinAvatar) {
throw new Error('Provided URL is not a Jellyfin avatar.');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/CachedImage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CachedImage = ({ src, type, ...props }: CachedImageProps) => {
} else if (type === 'avatar') {
// jellyfin avatar (in any)
const jellyfinAvatar = src.match(
/^.*?(\/Users\/\w+\/Images\/Primary\/?\?tag=\w+&quality=90)$/
/(\/Users\/\w+\/Images\/Primary\/?\?tag=\w+&quality=90)$/
)?.[1];
imageUrl = jellyfinAvatar ? `/avatarproxy` + jellyfinAvatar : src;
} else {
Expand Down

0 comments on commit 7429297

Please sign in to comment.