Skip to content

Commit 956f675

Browse files
committed
g3-http: clean code
1 parent 6b2f05b commit 956f675

File tree

6 files changed

+4
-8
lines changed

6 files changed

+4
-8
lines changed

lib/g3-http/src/client/response.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ impl HttpForwardRemoteResponse {
6868
pub fn adapt_to_chunked(&self, adapted: HttpAdaptedResponse) -> Self {
6969
let mut hop_by_hop_headers = self.hop_by_hop_headers.clone();
7070
if !self.chunked_transfer {
71-
hop_by_hop_headers.remove(header::CONTENT_LENGTH);
7271
if let Some(mut v) = hop_by_hop_headers.remove(header::TRANSFER_ENCODING) {
7372
v.set_static_value("chunked");
7473
hop_by_hop_headers.insert(header::TRANSFER_ENCODING, v);

lib/g3-http/src/client/transparent.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,9 @@ impl HttpTransparentResponse {
6969
}
7070
}
7171

72-
pub fn adaptat_to_chunked(&self, adapted: HttpAdaptedResponse) -> Self {
72+
pub fn adapt_to_chunked(&self, adapted: HttpAdaptedResponse) -> Self {
7373
let mut hop_by_hop_headers = self.hop_by_hop_headers.clone();
7474
if !self.chunked_transfer {
75-
hop_by_hop_headers.remove(header::CONTENT_LENGTH);
7675
if let Some(mut v) = hop_by_hop_headers.remove(header::TRANSFER_ENCODING) {
7776
v.set_static_value("chunked");
7877
hop_by_hop_headers.insert(header::TRANSFER_ENCODING, v);

lib/g3-http/src/server/request.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ impl HttpProxyClientRequest {
6868
}
6969
}
7070

71-
pub fn adapted_to_chunked(&self, adapted: HttpAdaptedRequest) -> Self {
71+
pub fn adapt_to_chunked(&self, adapted: HttpAdaptedRequest) -> Self {
7272
let mut hop_by_hop_headers = self.hop_by_hop_headers.clone();
7373
if !self.chunked_transfer {
74-
hop_by_hop_headers.remove(header::CONTENT_LENGTH);
7574
if let Some(mut v) = hop_by_hop_headers.remove(header::TRANSFER_ENCODING) {
7675
v.set_static_value("chunked");
7776
hop_by_hop_headers.insert(header::TRANSFER_ENCODING, v);

lib/g3-http/src/server/transparent.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ impl HttpTransparentRequest {
7676
pub fn adapt_to_chunked(&self, adapted: HttpAdaptedRequest) -> Self {
7777
let mut hop_by_hop_headers = self.hop_by_hop_headers.clone();
7878
if !self.chunked_transfer {
79-
hop_by_hop_headers.remove(header::CONTENT_LENGTH);
8079
if let Some(mut v) = hop_by_hop_headers.remove(header::TRANSFER_ENCODING) {
8180
v.set_static_value("chunked");
8281
hop_by_hop_headers.insert(header::TRANSFER_ENCODING, v);

lib/g3-icap-client/src/reqmod/h1/impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl HttpRequestForAdaptation for HttpProxyClientRequest {
4444
}
4545

4646
fn adapt_to_chunked(&self, other: HttpAdaptedRequest) -> Self {
47-
self.adapted_to_chunked(other)
47+
self.adapt_to_chunked(other)
4848
}
4949
}
5050

lib/g3-icap-client/src/respmod/h1/impl_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl HttpResponseForAdaptation for HttpTransparentResponse {
5454
}
5555

5656
fn adapt_to_chunked(&self, other: HttpAdaptedResponse) -> Self {
57-
self.adaptat_to_chunked(other)
57+
self.adapt_to_chunked(other)
5858
}
5959
}
6060

0 commit comments

Comments
 (0)