Add .trailers to Response/Request#1940
Open
jasnell wants to merge 1 commit into
Open
Conversation
jasnell
commented
Jul 11, 2026
| <p>A <dfn export>trailer state</dfn> is a <a for=/>struct</a> used to represent | ||
| HTTP trailer fields received after a response body | ||
| ([[HTTP]], <a href="https://httpwg.org/specs/rfc9110.html#trailers">Section 6.5</a>). | ||
| It has: |
Author
There was a problem hiding this comment.
The struct here is really only to deal with cloning... wasn't sure if it would be better to go more specific / concrete or to describe things in a more generic / hand wavy way... went with more specific.
Adds `Promise<Headers>` `trailers` properties to `Request` and `Response` When sending... `trailers` resolves to an empty, immutable `Headers` since we're not dealing with sending trailers in this change. When receiving... `trailers` resolves to an immutable, populated/filtered `Headers` resolved after the body is completed. This means the trailers promise will not resolve if the body is not consumed.
aca5d2b to
3cbc607
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
Promise<Headers>trailersproperties toRequestandResponseWhen sending...
trailersresolves to an empty, immutableHeaderssince we're not dealing with sending trailers in this change.When receiving...
trailersresolves to an immutable, populated/filteredHeadersresolved after the body is completed. This means the trailers promise will not resolve if the body is not consumed.The minimal conformance requirement here is the presence of the
.trailersproperty. An implementation which chooses not to actually support trailers would need only return a resolved promise with an immutable emptyHeaders. Nothing in this should be interpreted as requiring any implementation to actually implement trailers support.Refs: #981
(See WHATWG Working Mode: Changes for more details.)
💥 Error: 422 Unprocessable Entity 💥
PR Preview failed to build. (Last tried on Jul 11, 2026, 5:40 PM UTC).
More
PR Preview relies on a number of web services to run. There seems to be an issue with the following one:
🚨 Spec Generator - Spec Generator is the web service used to build bikeshed/ReSpec specs
🔗 Related URL
Error output:
[ { "lineNum": "1675:17", "messageType": "link", "text": "Multiple possible 'dfn' local refs for 'trailer state'.\nRandomly chose one of them; other instances might get a different random choice." }, { "lineNum": "1679:51", "messageType": "link", "text": "Multiple possible 'dfn' local refs for 'trailer state'.\nRandomly chose one of them; other instances might get a different random choice." }, { "lineNum": "1699:48", "messageType": "link", "text": "Multiple possible 'dfn' local refs for 'trailer state'.\nRandomly chose one of them; other instances might get a different random choice." }, { "lineNum": "2652:4", "messageType": "link", "text": "Multiple possible 'dfn' local refs for 'trailer state'.\nRandomly chose one of them; other instances might get a different random choice." }, { "lineNum": "2652:63", "messageType": "link", "text": "Multiple possible 'dfn' local refs for 'trailer state'.\nRandomly chose one of them; other instances might get a different random choice." }, { "lineNum": null, "messageType": "failure", "text": "Did not generate, due to errors exceeding the allowed error level." } ]This seems to be an issue with the Spec Generator service. PR Preview doesn't manage this service and so has no control over it. If you've identified an issue with it, you can report the issue to the maintainers of Spec Generator directly. Please be courteous. Thank you!
If you don't have enough information above to solve the error by yourself or if the issue doesn't seem related to Spec Generator, you can file an issue with PR Preview.