Skip to content

Commit

Permalink
fix(isDataURI): fix dataURI mediaType format (#1916)
Browse files Browse the repository at this point in the history
* fix(isDataURI): fix dataURI mediaType format

* fix(isDataURI): add test dataURI for mediaType with dots

* fix(isDataURI): fix test dataURI for mediaType with dots
  • Loading branch information
temoffey authored Apr 22, 2022
1 parent 4b8eac5 commit 066869c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isDataURI.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assertString from './util/assertString';

const validMediaType = /^[a-z]+\/[a-z0-9\-\+]+$/i;
const validMediaType = /^[a-z]+\/[a-z0-9\-\+\.]+$/i;

const validAttribute = /^[a-z\-]+=[a-z0-9\-]+$/i;

Expand Down
1 change: 1 addition & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -10199,6 +10199,7 @@ describe('Validators', () => {
' data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E',
'data:,A%20brief%20note',
'data:text/html;charset=US-ASCII,%3Ch1%3EHello!%3C%2Fh1%3E',
'data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,dGVzdC5kb2N4',
],
invalid: [
'dataxbase64',
Expand Down

0 comments on commit 066869c

Please sign in to comment.