Skip to content

Keep the HTTP/2 priority header and combine its field lines - #1274

Open
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:h2-priority-header
Open

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:h2-priority-header

Conversation

@arturobernalg

@arturobernalg arturobernalg commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Over HTTP/2 the priority request header never reaches the application. Tomcat parses it for the stream urgency and then drops it, so request.getHeader("priority") returns null, while over HTTP/1.1 the same request shows it. RFC 9218 calls it an end-to-end signal, so a servlet that proxies the request loses it.

Each priority field line was also parsed on its own. A request with "priority: u=0" followed by "priority: i" ended up with the default urgency, because the second line reset it. RFC 9651 section 4.2 says the lines MUST be combined into one value before parsing.

The header is now stored like any other request header, and the combined value is parsed once the header block is complete. A priority field sent in the trailers no longer changes the stream priority.

Tests are added to TestRfc9218.

This touches the same method as #1272. Whichever lands second needs the buffered PRIORITY_UPDATE applied after the header is parsed, since section 7 of RFC 9218 says the frame wins.

The priority request header was consumed by the HTTP/2 stream and never
reached the application, unlike HTTP/1.1. Each field line was also
parsed on its own, so "priority: u=0" followed by "priority: i" reset
the urgency to the default. RFC 9651 requires the lines to be combined
before parsing.
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.

1 participant