Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove HTTP response headers for the remoting-based CLI #5452

Merged
merged 2 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions core/src/main/java/hudson/Functions.java
Original file line number Diff line number Diff line change
Expand Up @@ -2284,15 +2284,6 @@ public static void advertiseHeaders(HttpServletResponse rsp) {
rsp.setHeader("X-Hudson","1.395");
rsp.setHeader("X-Jenkins", Jenkins.VERSION);
rsp.setHeader("X-Jenkins-Session", Jenkins.SESSION_HASH);

TcpSlaveAgentListener tal = j.tcpSlaveAgentListener;
if (tal != null) { // headers used only by deprecated Remoting-based CLI
int p = tal.getAdvertisedPort();
rsp.setIntHeader("X-Hudson-CLI-Port", p);
rsp.setIntHeader("X-Jenkins-CLI-Port", p);
rsp.setIntHeader("X-Jenkins-CLI2-Port", p);
rsp.setHeader("X-Jenkins-CLI-Host", TcpSlaveAgentListener.CLI_HOST_NAME);
}
}
}

Expand Down
1 change: 0 additions & 1 deletion test/src/test/java/hudson/cli/CLITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ public void redirectToEndpointShouldBeFollowed() throws Exception {
WebResponse rsp = wc.goTo("cli-proxy/").getWebResponse();
assertEquals(rsp.getContentAsString(), HttpURLConnection.HTTP_MOVED_TEMP, rsp.getStatusCode());
assertNull(rsp.getContentAsString(), rsp.getResponseHeaderValue("X-Jenkins"));
assertNull(rsp.getContentAsString(), rsp.getResponseHeaderValue("X-Jenkins-CLI-Port"));

for (String transport: Arrays.asList("-http", "-webSocket")) {

Expand Down