File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ use std::str::FromStr;
14
14
15
15
use crate :: chunked:: ChunkedDecoder ;
16
16
use crate :: error:: HttpError ;
17
+ use crate :: date:: fmt_http_date;
17
18
use crate :: { Exception , MAX_HEADERS } ;
18
19
19
20
/// An HTTP encoder.
@@ -77,6 +78,11 @@ pub async fn encode(req: Request) -> Result<Encoder, std::io::Error> {
77
78
// See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding
78
79
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
79
80
}
81
+
82
+ let date = fmt_http_date ( std:: time:: SystemTime :: now ( ) ) ;
83
+ let val = format ! ( "Date: {}\r \n " , date) ;
84
+ buf. write_all ( val. as_bytes ( ) ) . await ?;
85
+
80
86
for ( header, values) in req. iter ( ) {
81
87
for value in values. iter ( ) {
82
88
let val = format ! ( "{}: {}\r \n " , header, value) ;
You can’t perform that action at this time.
0 commit comments