Skip to content

import() should use referring script's base URL as the referrer #3744

@domenic

Description

@domenic

Right now we treat import() as a "new" module script graph, i.e. it calls fetch a module script graph directly. This then uses "client" as the referrer, i.e. it uses the base URL of the appropriate settings object.

But this seems semantically wrong. import() knows what script it's being called from; it uses that information to compute URLs and and fetch options. It should also use that to compute the referrer information.

Found by @jonco3. /cc @whatwg/modules. I will try to work on a spec fix and tests for this soon...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions