-
Notifications
You must be signed in to change notification settings - Fork 190
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
Add request ID to response headers #2438
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
0b817b9
to
147eef2
Compare
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
This reverts commit 147eef2.
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
733701a
to
a244b9d
Compare
CHANGELOG.next.toml
Outdated
``` | ||
""" | ||
references = ["smithy-rs#2438"] | ||
meta = { "breaking" = false, "tada" = false, "bug" = false, "target" = "server"} |
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.
Technically, this is a breaking change:
- type Future = S::Future;
+ type Future = ServerRequestIdResponseFuture<S::Future>;
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
A new generated diff is ready to view.
A new doc preview is ready to view. |
//! To optionally add the [`ServerRequestId`] to the response headers, use [`ServerRequestIdProviderLayer::new_with_response_header`]. | ||
//! Use [`ServerRequestIdProviderLayer::new`] to use [`ServerRequestId`] in your handler. | ||
//! Use [`ServerRequestIdProviderLayer::new_with_response_header`] to use [`ServerRequestId`] in your handler and add it to the response headers. |
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.
We speak of the fact that the server request id can be returned to the caller a couple of paragraphs above, I think it makes sense to mention the relevant constructor there.
pub struct ServerRequestIdProviderLayer; | ||
pub struct ServerRequestIdProviderLayer { | ||
header_key: Option<HeaderName>, | ||
} | ||
|
||
impl ServerRequestIdProviderLayer { | ||
/// Generate a new unique 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.
I'd update this to mention this other constructor and explain that it won't add it to the response headers (and vice versa in the docs for the other method).
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.
A couple of docs comments, good to go otherwise!
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
A new generated diff is ready to view.
A new doc preview is ready to view. |
Signed-off-by: Daniele Ahmed <ahmeddan@amazon.de>
A new generated diff is ready to view.
A new doc preview is ready to view. |
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.