Modify response to have via and server headers#1033
Modify response to have via and server headers#1033aryan9600 wants to merge 1 commit intolinkerd:mainfrom
via and server headers#1033Conversation
|
@aryan9600 What do you think about omitting the I think adding a |
| } | ||
|
|
||
| let status = http_status(&*error); | ||
| const SERVER_HEADER: &'static str = concat!("linkerd-proxy/", env!("CARGO_PKG_VERSION")); |
There was a problem hiding this comment.
i don't think it's really correct to use the cargo package version as the proxy's version. this is going to be the version of the linkerd-app-core crate, which isn't the actual proxy version: https://github.com/aryan9600/linkerd2-proxy/blob/6438d0d19dafc22d6645d198b566085c7c5d0e73/linkerd/app/core/Cargo.toml#L3
instead, we should probably use the GIT_VERSION env var, which is the current proxy version git tag, set by the build script:
linkerd2-proxy/linkerd/app/core/build.rs
Lines 24 to 27 in 1223447
| const SERVER_HEADER: &'static str = concat!("linkerd-proxy/", env!("CARGO_PKG_VERSION")); | |
| const SERVER_HEADER: &'static str = concat!("linkerd-proxy/", env!("GIT_VERSION")); |
There was a problem hiding this comment.
the linting checks on CI are failing because the clippy linter doesn't like the explicit 'static lifetime here (constants always have the 'static lifetime). to get CI passing, we should probably remove it:
| const SERVER_HEADER: &'static str = concat!("linkerd-proxy/", env!("CARGO_PKG_VERSION")); | |
| const SERVER_HEADER: &str = concat!("linkerd-proxy/", env!("CARGO_PKG_VERSION")); |
There was a problem hiding this comment.
oops, forgot to consult clippy before pushing 😅
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
6438d0d to
9ce57f5
Compare
This PR addresses linkerd/linkerd2#2295.
I am not very confident about this PR, hence the draft PR.
Also, a rather peculiar thing, checking the response via the viz dashboard doesn't show the
viaorserverheader, but the debug statements do confirm that the response has been modified. It'd be great if I could get some feedback on how to improve this.