mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-06 16:45: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();
|
||||
|
||||
Reference in new issue
Block a user