feat(request-id): Add request-id constructor#552
Open
tottoto wants to merge 1 commit intotower-rs:mainfrom
Open
feat(request-id): Add request-id constructor#552tottoto wants to merge 1 commit intotower-rs:mainfrom
tottoto wants to merge 1 commit intotower-rs:mainfrom
Conversation
f532cd1 to
6496831
Compare
jplatte
reviewed
Mar 24, 2025
tower-http/src/request_id.rs
Outdated
| use tower_service::Service; | ||
| use uuid::Uuid; | ||
|
|
||
| pub(crate) const REQUEST_ID: HeaderName = HeaderName::from_static("x-request-id"); |
Member
There was a problem hiding this comment.
This still has the x- 😄
But also, do you have a link to docs for the non-x--prefixed header?
Contributor
Author
There was a problem hiding this comment.
Fixed, and rebased to resolve the conflict.
Contributor
Author
There was a problem hiding this comment.
https://www.rfc-editor.org/rfc/rfc6648 deprecates "X-" prefix header, and request-id is also commonly used same as x-request-id.
Member
There was a problem hiding this comment.
The RFC says "deprecates the convention for newly defined parameters" (emphasis mine) though. Do you have a source for the claim that it's commonly used?
6496831 to
b8e0d1b
Compare
b8e0d1b to
a9ef9e7
Compare
Contributor
|
FWIW might want to add a unit test to also test the request_id one. It's dumb logic, but it's easy enough to copy one of the x-request-id ones :) |
GlenDC
added a commit
to plabayo/rama
that referenced
this pull request
Mar 25, 2025
originally contributed to tower-http by @tottoto in <tower-rs/tower-http#552> Co-authored-by: tottoto <tottotodev@gmail.com>
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.
Motivation
Provides the same constructor of request-id as x-request-id.
Solution
Adds request-id constructor.