Skip to content

Commit 4580118

Browse files
authored
Merge pull request #89 from gdamjan/remove-request-date
no need to send date header in client
2 parents 9d289a4 + d1eba8b commit 4580118

File tree

3 files changed

+0
-9
lines changed

3 files changed

+0
-9
lines changed

src/client/encode.rs

-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ use http_types::{Method, Request};
66

77
use std::pin::Pin;
88

9-
use crate::date::fmt_http_date;
10-
119
/// An HTTP encoder.
1210
#[doc(hidden)]
1311
#[derive(Debug)]
@@ -91,11 +89,6 @@ impl Encoder {
9189
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer
9290
}
9391

94-
let date = fmt_http_date(std::time::SystemTime::now());
95-
buf.write_all(b"date: ").await?;
96-
buf.write_all(date.as_bytes()).await?;
97-
buf.write_all(b"\r\n").await?;
98-
9992
for (header, values) in req.iter() {
10093
for value in values.iter() {
10194
let val = format!("{}: {}\r\n", header, value);

tests/fixtures/request-add-date.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
POST / HTTP/1.1
22
host: localhost:8080
33
content-length: 5
4-
date: {DATE}
54
content-type: text/plain; charset=utf-8
65

76
hello

tests/fixtures/request-with-connect.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ CONNECT example.com:443 HTTP/1.1
22
host: example.com
33
proxy-connection: keep-alive
44
content-length: 0
5-
date: {DATE}
65

0 commit comments

Comments
 (0)