Skip to content

FormData, Response, Request, and Headers have incorrect property descriptors #45099

Description

@KhafraDev

Version

v18.11.0

Platform

Microsoft Windows NT 10.0.19043.0 x64

Subsystem

No response

What steps will reproduce the bug?

The property descriptors should match such that this test succeeds:

for (const global of [
  'Headers',
  'Request',
  'Response',
  'FormData'
]) {
  const desc = Object.getOwnPropertyDescriptor(globalThis, global)
  
  assert.notStrictEqual(desc, undefined)
  assert.deepStrictEqual(desc.value, globalThis[global])
  assert.ok(desc.writable)
  assert.ok(!desc.enumerable)
  assert.ok(desc.configurable)
}

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

the tests from above pass

What do you see instead?

the descriptors are inconsistent with other environments

Additional information

No response

Activity

  1. changed the title [-]FormData, Response, Request, and Headers[/-] [+]FormData, Response, Request, and Headers have incorrect property descriptors[/+] on Oct 20, 2022
  2. bnoordhuis commented on Oct 20, 2022

    @bnoordhuis
    Member

    If you submit that to WPT, then node will fix that next time we update.

    If WPT already contains tests but we're not testing that particular submodule, then please see test/wpt/README.md for how to enable them.

  3. KhafraDev commented on Oct 20, 2022

    @KhafraDev
    MemberAuthor

    The tests exist https://github.com/web-platform-tests/wpt/blob/master/fetch/api/idlharness.any.js

    I will look into enabling these tests in node but I've never worked with node's WPT runner and idlharness tests are a little more involved than other tests. 👍

  4. targos commented on Oct 22, 2022

    @targos
    Member

    I think we already run idlharness tests for other features (for example URL) without issues.

  5. added
    confirmed-bugIssues and PRs for confirmed bugs.
    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.
    on Oct 22, 2022
  6. KhafraDev commented on Oct 22, 2022

    @KhafraDev
    MemberAuthor

    Cool, I'll look into it once a new version of undici is released and is updated in node. Otherwise a few tests will fail that don't anymore.

  7. aduh95 commented on Oct 24, 2022

    @aduh95
    Contributor

    We should probably make sure that Undici is snapshotted, so we can get rid of the lazy-loading without perf implications.

  8. techsavvyash commented on Feb 4, 2023

    @techsavvyash

    Hey Team.
    I am a newbie dev starting out in OSS, I would like to take this issue up, can anyone help me navigate through and fix this.
    Thanks

  9. KhafraDev commented on Feb 4, 2023

    @KhafraDev
    MemberAuthor

    I don't think this issue is actionable. Other globals (Blob and File, if File is ever made a global...) were made getters as well in #45659.

    Caveat: we have to make some of the globals lazily-loaded too

  10. LeonxLJX commented on Sep 1, 2026

    @LeonxLJX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.help wantedIssues that need assistance from volunteers or PRs that need help to proceed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions