Skip to content

Commit 9ce57f5

Browse files
committed
Modify response headers
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 parent aabd5a5 commit 9ce57f5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

linkerd/app/core/src/errors.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,13 @@ impl<RspB: Default + hyper::body::HttpBody> respond::Respond<http::Response<RspB
205205
close.close();
206206
}
207207

208+
const SERVER_HEADER: &str = concat!("linkerd-proxy/", env!("GIT_VERSION"));
208209
if self.is_grpc {
209210
let mut rsp = http::Response::builder()
210211
.version(http::Version::HTTP_2)
211212
.header(http::header::CONTENT_LENGTH, "0")
212213
.header(http::header::CONTENT_TYPE, GRPC_CONTENT_TYPE)
214+
.header(http::header::SERVER, SERVER_HEADER)
213215
.body(ResponseBody::default())
214216
.expect("app::errors response is valid");
215217
let code = set_grpc_status(&*error, rsp.headers_mut());
@@ -223,6 +225,7 @@ impl<RspB: Default + hyper::body::HttpBody> respond::Respond<http::Response<RspB
223225
.version(self.version)
224226
.status(status)
225227
.header(http::header::CONTENT_LENGTH, "0")
228+
.header(http::header::SERVER, SERVER_HEADER)
226229
.body(ResponseBody::default())
227230
.expect("error response must be valid"))
228231
}

0 commit comments

Comments
 (0)