Skip to content

Commit

Permalink
First iteration fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Elkin committed Nov 13, 2017
1 parent b46ad7a commit 01d21ca
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 48 deletions.
26 changes: 1 addition & 25 deletions karma.conf.js
Expand Up @@ -65,31 +65,7 @@ module.exports = (config) => {
served: true
},
{
pattern: 'test/images/*.png',
watched: false,
included: false,
served: true
},
{
pattern: 'test/images/*.jpg',
watched: false,
included: false,
served: true
},
{
pattern: 'test/images/*.gif',
watched: false,
included: false,
served: true
},
{
pattern: 'test/images/*.svg',
watched: false,
included: false,
served: true
},
{
pattern: 'test/images/*.bmp',
pattern: 'test/images/*.+(png|jpg|gif|svg|bmp)',
watched: false,
included: false,
served: true
Expand Down
4 changes: 2 additions & 2 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/validationHelper.ts
Expand Up @@ -28,8 +28,8 @@ module powerbi.extensibility.utils.dataview {
export module validationHelper {
export function isImageUrlAllowed(url: string): boolean {
// Excludes all URLs that don't contain .gif .jpg .png or .svg extensions and don't start from "http(s)://".
// As a result -- also excludes all directives such as "javascript:", "data:" and "blob:".
return (/^https?:\/\/.+\.(gif|jpg|png|svg)$/i).test(url);
// Base64 incoded images are allowable too.
return (/^https?:\/\/.+\.(gif|jpg|png|svg)$/i).test(url) || (/^data:image\/(gif|jpeg|png|svg\+xml);base64,/i).test(url);
}

export function isFileImage(url: string, imageCheckResultCallBack: (isImage: boolean, contentType: string) => void) {
Expand Down
2 changes: 1 addition & 1 deletion test/data/someplaintext.txt
@@ -1 +1 @@
Plain text with some data taht is used in unit tests
Plain text with some data that is used in unit tests
1 change: 1 addition & 0 deletions test/images/justok.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 0 additions & 14 deletions test/images/sun.svg

This file was deleted.

0 comments on commit 01d21ca

Please sign in to comment.