Skip to content

Commit fa38adc

Browse files
committed
User ServerTiming::value internally
Fixes a bug!
1 parent d1a631f commit fa38adc

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/trace/server_timing/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ impl ServerTiming {
8585

8686
/// Sets the `Server-Timing` header.
8787
pub fn apply(&self, mut headers: impl AsMut<Headers>) {
88-
for timing in &self.timings {
89-
let value: HeaderValue = timing.clone().into();
90-
headers.as_mut().insert(SERVER_TIMING, value);
91-
}
88+
headers.as_mut().insert(SERVER_TIMING, self.value());
9289
}
9390

9491
/// Get the `HeaderName`.
@@ -102,7 +99,7 @@ impl ServerTiming {
10299
for (n, timing) in self.timings.iter().enumerate() {
103100
let timing: HeaderValue = timing.clone().into();
104101
match n {
105-
1 => write!(output, "{}", timing).unwrap(),
102+
0 => write!(output, "{}", timing).unwrap(),
106103
_ => write!(output, ", {}", timing).unwrap(),
107104
};
108105
}

0 commit comments

Comments
 (0)