Skip to content

Conversation

@Harish3005-cloud
Copy link
Contributor

Updated the syntax block to show that multiple preferences are allowed as per the RFC. Added an example demonstrating multiple preferences in a single header. Fixes #42535

Description

I updated the "Syntax" section to reflect that the Prefer header accepts a comma-separated list of preferences. I also added a new "Providing multiple preferences" example to demonstrate this behavior.

Motivation

The RFC 7240 specification defines the Prefer header grammar as 1#preference, meaning multiple preferences are allowed in a comma-separated list. The previous documentation implied only a single preference was valid, which was misleading for developers trying to set multiple directives (e.g., respond-async and wait).

Additional details

Reference: RFC 7240 Section 2 - The Prefer Header Field

Related issues and pull requests

Updated the syntax block to show that multiple preferences are allowed as per the RFC. Added an example demonstrating multiple preferences in a single header. Fixes mdn#42535
@Harish3005-cloud Harish3005-cloud requested a review from a team as a code owner December 30, 2025 18:56
@Harish3005-cloud Harish3005-cloud requested review from hamishwillee and removed request for a team December 30, 2025 18:56
@github-actions github-actions bot added Content:HTTP HTTP docs size/xs [PR only] 0-5 LoC changed labels Dec 30, 2025
@github-actions
Copy link
Contributor

Preview URLs

Flaws (4)

URL: /en-US/docs/Web/HTTP/Reference/Headers/Prefer
Title: Prefer header
Flaw count: 4

  • macros:
    • Macro glossary produces link /en-US/docs/Glossary/Forbidden_header_name which is a redirect
  • unknown:
    • No generic content config found
    • no blog root
    • no blog root

Copy link
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

Thanks very much. There are a number of ways to show optional lists in HTTP section, but this is the most common one.

@hamishwillee hamishwillee merged commit f5366c0 into mdn:main Jan 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTTP HTTP docs size/xs [PR only] 0-5 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<preference> specification for Prefers is misleading -- _at least_ one preference is required (1# for ABNF as per the RFC)

2 participants