mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-06 00:25:58 +00:00
Detect if the remote server is really Hudson.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17605 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
66a340105b
commit
bb4ccdad87
2 files changed
+4
-3
No files matched your search
@@ -1,8 +1,5 @@
|
||||
package hudson.cli;
|
||||
|
||||
import hudson.cli.SequenceOutputStream.Block;
|
||||
|
||||
import java.io.FilterOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@@ -45,6 +42,9 @@ public class FullDuplexHttpStream {
|
||||
con.addRequestProperty("Side","download");
|
||||
con.getOutputStream().close();
|
||||
input = con.getInputStream();
|
||||
// make sure we hit the right URL
|
||||
if(con.getHeaderField("Hudson-Duplex")==null)
|
||||
throw new IOException(target+" doesn't look like Hudson");
|
||||
|
||||
// client->server uses chunked encoded POST for unlimited capacity.
|
||||
con = (HttpURLConnection) target.openConnection();
|
||||
|
||||
@@ -2712,6 +2712,7 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
|
||||
requirePOST();
|
||||
|
||||
UUID uuid = UUID.fromString(req.getHeader("Session"));
|
||||
rsp.setHeader("Hudson-Duplex",""); // set the header so that the client would know
|
||||
final Authentication auth = getAuthentication();
|
||||
|
||||
FullDuplexHttpChannel server;
|
||||
|
||||
Reference in new issue
Block a user