Skip to content

Commit 3ba0d42

Browse files
Merge pull request #566 from rdkcentral/fix/image-worker-url
2 parents 313e174 + 0489e05 commit 3ba0d42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/platforms/browser/WebPlatform.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,16 @@ export default class WebPlatform {
290290
}
291291
} else if (this._imageWorker) {
292292
// WPE-specific image parser.
293-
if (typeof src !== 'string' || src.indexOf('://') < 0) {
293+
if (typeof src !== 'string') {
294294
return cb("Invalid image URL");
295295
}
296+
297+
// URL can start with http://, https://, and //
298+
const separatorPos = src.indexOf('//');
299+
if (separatorPos !== 0 && separatorPos !== 5 && separatorPos !== 6) {
300+
return cb("Invalid image URL");
301+
}
302+
296303
const image = this._imageWorker.create(src);
297304
image.onError = function (err) {
298305
return cb("Image load error");

0 commit comments

Comments
 (0)