We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 313e174 + 0489e05 commit 3ba0d42Copy full SHA for 3ba0d42
src/platforms/browser/WebPlatform.mjs
@@ -290,9 +290,16 @@ export default class WebPlatform {
290
}
291
} else if (this._imageWorker) {
292
// WPE-specific image parser.
293
- if (typeof src !== 'string' || src.indexOf('://') < 0) {
+ if (typeof src !== 'string') {
294
return cb("Invalid image URL");
295
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
303
const image = this._imageWorker.create(src);
304
image.onError = function (err) {
305
return cb("Image load error");
0 commit comments