-
Notifications
You must be signed in to change notification settings - Fork 185
feat(request-id): Add request-id constructor #552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f532cd1
to
6496831
Compare
tower-http/src/request_id.rs
Outdated
@@ -181,6 +181,7 @@ use tower_layer::Layer; | |||
use tower_service::Service; | |||
use uuid::Uuid; | |||
|
|||
pub(crate) const REQUEST_ID: HeaderName = HeaderName::from_static("x-request-id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still has the x-
😄
But also, do you have a link to docs for the non-x-
-prefixed header?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, and rebased to resolve the conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.rfc-editor.org/rfc/rfc6648 deprecates "X-" prefix header, and request-id
is also commonly used same as x-request-id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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 :) |
originally contributed to tower-http by @tottoto in <tower-rs/tower-http#552> Co-authored-by: tottoto <tottotodev@gmail.com>
Motivation
Provides the same constructor of request-id as x-request-id.
Solution
Adds request-id constructor.