Skip to content

Commit 281f9c1

Browse files
authored
Merge branch 'master' into refactor-stuff
2 parents f2fe2f8 + c687267 commit 281f9c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::time::Duration;
1313

1414
use std::pin::Pin;
1515

16+
use crate::date::fmt_http_date;
1617
use crate::{Exception, MAX_HEADERS};
1718

1819
/// Parse an incoming HTTP connection.
@@ -135,6 +136,10 @@ impl Encoder {
135136
} else {
136137
std::io::Write::write_fmt(&mut head, format_args!("Transfer-Encoding: chunked\r\n"))?;
137138
}
139+
140+
141+
let date = fmt_http_date(std::time::SystemTime::now());
142+
std::io::Write::write_fmt(&mut buf, format_args!("Date: {}\r\n", date))?;
138143

139144
for (header, value) in self.res.headers().iter() {
140145
std::io::Write::write_fmt(

0 commit comments

Comments
 (0)