Skip to content

Module loader does not allow parameters in data: URIs #30488

Closed
@jbemmel

Description

@jbemmel

The regex at https://github.com/nodejs/node/blob/master/lib/internal/modules/esm/translators.js#L42 defines the allowable data: URIs:

const DATA_URL_PATTERN = /^[^/]+\/[^,;]+(;base64)?,([\s\S]*)$/;

This rejects valid RFC2397 data: URIs with media parameters, like
data:text/javascript;charset=utf-8;base64,xxxx

Likewise, a valid URI like
data:,A%20brief%20note
is rejected ( '/' character is required in the media type - even though the media type is not used )

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedPRs that are blocked by other issues or PRs.known limitationIssues that are identified as known limitations.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions