Skip to content

Base64 images matched as external URLs #3

@andresscode

Description

@andresscode

Problem

The following line is making the No Network Calls check fail:

this.load.image('myBase64Image', 'data:image/png;base64,iVBORw0KGgoAAAA...')

The regex isn't excluding the data:image/ URLs.

const externalUrlPattern = /(https?:\/\/|\/\/[a-zA-Z0-9])/g;

Solution

A simple solution is to exclude from the gameCode the data images:

const lines = gameCode.replace(/data:[^,]+,[^\s'"`)]+/g, '').split('\n');

cc @rafafdz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions