Skip to content

Commit

Permalink
rename to write_response_headers
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislearn committed Oct 11, 2023
1 parent 0fdb17e commit 1044e04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/extra/src/sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ where
}

#[inline]
fn write_request_headers(res: &mut Response) {
fn write_response_headers(res: &mut Response) {
res.headers_mut()
.insert(CONTENT_TYPE, HeaderValue::from_static("text/event-stream"));
// Disable response body caching
Expand All @@ -275,7 +275,7 @@ where
S: TryStream<Ok = SseEvent> + Send + 'static,
S::Error: StdError + Send + Sync + 'static,
{
write_request_headers(res);
write_response_headers(res);
let body_stream = event_stream
.map_err(|e| {
tracing::error!("sse stream error: {}", e);
Expand Down

0 comments on commit 1044e04

Please sign in to comment.