File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,8 @@ pub(crate) async fn serve(config: Config) {
134
134
let x_request_id = HeaderName :: from_static ( "x-request-id" ) ;
135
135
136
136
// Basic access logging
137
- app = app. layer (
137
+ app = app. layer ( {
138
+ let x_request_id = x_request_id. clone ( ) ;
138
139
TraceLayer :: new_for_http ( ) . make_span_with ( move |req : & Request < _ > | {
139
140
const REQUEST_ID : & str = "request_id" ;
140
141
@@ -152,10 +153,8 @@ pub(crate) async fn serve(config: Config) {
152
153
}
153
154
154
155
span
155
- } ) ,
156
- ) ;
157
-
158
- let x_request_id = HeaderName :: from_static ( "x-request-id" ) ;
156
+ } )
157
+ } ) ;
159
158
160
159
// propagate `x-request-id` headers from request to response
161
160
app = app. layer ( PropagateRequestIdLayer :: new ( x_request_id. clone ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments