Skip to content

fix: [#2112] Add missing destination property to Request#2136

Open
coffeeandwork wants to merge 1 commit into
capricorn86:masterfrom
coffeeandwork:fix/2112-request-destination-property
Open

fix: [#2112] Add missing destination property to Request#2136
coffeeandwork wants to merge 1 commit into
capricorn86:masterfrom
coffeeandwork:fix/2112-request-destination-property

Conversation

@coffeeandwork
Copy link
Copy Markdown
Contributor

request.destination was returning undefined because the property wasn't implemented. Per the fetch spec, the destination is always "" for requests created via the Request constructor or fetch() — the browser only sets it to something meaningful internally for resource loads (scripts, images, stylesheets, etc.).

Added a read-only getter that returns "".

Fixes #2112

Testing

Added a check for destination in the existing default properties test. All existing Request tests still pass.

Request was missing the destination getter, so accessing
request.destination returned undefined instead of the empty string.

Per the spec, destination is always "" for requests created via the
Request constructor or fetch() — the browser only sets it internally
for resource loads (scripts, images, etc.).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Destination property on Request is missing

2 participants