Skip to content

Commit

Permalink
Fix MIME check for JPEG in lightbox copy handler (#4643)
Browse files Browse the repository at this point in the history
* Fix MIME check for JPEG in lightbox copy handler

* Handle both image/jpeg and non-standard image/jpg
  • Loading branch information
vinhowe authored and josh-signal committed Nov 23, 2020
1 parent 24b70e6 commit e398520
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ts/components/Lightbox.tsx
Expand Up @@ -425,7 +425,11 @@ export class Lightbox extends React.Component<Props, State> {
const { contentType } = this.props;

// These are the only image types supported by Electron's NativeImage
if (event && contentType !== 'image/png' && contentType !== 'image/jpg') {
if (
event &&
contentType !== 'image/png' &&
!contentType?.match(/image\/jpe?g/g)
) {
event.preventDefault();
}
};
Expand Down

0 comments on commit e398520

Please sign in to comment.