Skip to content

fetch: handle invalid priority values properly#4522

Merged
Uzlopak merged 1 commit into
mainfrom
handle-invalid-priority-values
Sep 26, 2025
Merged

fetch: handle invalid priority values properly#4522
Uzlopak merged 1 commit into
mainfrom
handle-invalid-priority-values

Conversation

@Uzlopak

@Uzlopak Uzlopak commented Sep 6, 2025

Copy link
Copy Markdown
Contributor

increase wpt conformance, lol

This relates to...

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

@Uzlopak Uzlopak requested a review from Copilot September 6, 2025 06:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves Web Platform Tests (WPT) conformance by properly handling invalid priority values in the fetch API. The changes ensure that the Request constructor and fetch function correctly throw TypeError exceptions when invalid priority values are provided, matching the expected web standard behavior.

  • Adds proper validation for the priority option in RequestInit with allowed values of 'high', 'low', and 'auto'
  • Updates test expectations to reflect that previously failing tests now pass

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/web/fetch/request.js Adds priority field validation to RequestInit converter with allowed values and default
test/web-platform-tests/expectation.json Updates test expectations to mark priority validation tests as passing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Uzlopak Uzlopak merged commit 1c15cd4 into main Sep 26, 2025
32 of 34 checks passed
@Uzlopak Uzlopak deleted the handle-invalid-priority-values branch September 26, 2025 11:13
@github-actions github-actions Bot mentioned this pull request Jan 5, 2026
slagiewka pushed a commit to slagiewka/undici that referenced this pull request Feb 14, 2026
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.

3 participants