fix up http issues?
This commit is contained in:
parent
96538ba249
commit
a29461057e
|
@ -147,7 +147,7 @@ public class SimpleHTTPClient {
|
|||
}
|
||||
}
|
||||
|
||||
return new HTTPResult(url, c.getResponseCode(), c.getRequestProperty("Content-Type"), TextFile.streamToBytes(c.getInputStream()));
|
||||
return new HTTPResult(url, c.getResponseCode(), c.getRequestProperty("Content-Type"), TextFile.streamToBytes(c.getResponseCode() >= 400 ? c.getErrorStream() : c.getInputStream()));
|
||||
}
|
||||
|
||||
private void setHeaders(HttpURLConnection c) {
|
||||
|
@ -177,7 +177,7 @@ public class SimpleHTTPClient {
|
|||
setHeaders(c);
|
||||
c.getOutputStream().write(content);
|
||||
c.getOutputStream().close();
|
||||
return new HTTPResult(url, c.getResponseCode(), c.getRequestProperty("Content-Type"), TextFile.streamToBytes(c.getInputStream()));
|
||||
return new HTTPResult(url, c.getResponseCode(), c.getRequestProperty("Content-Type"), TextFile.streamToBytes(c.getResponseCode() >= 400 ? c.getErrorStream() : c.getInputStream()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -194,7 +194,7 @@ public class SimpleHTTPClient {
|
|||
setHeaders(c);
|
||||
c.getOutputStream().write(content);
|
||||
c.getOutputStream().close();
|
||||
return new HTTPResult(url, c.getResponseCode(), c.getRequestProperty("Content-Type"), TextFile.streamToBytes(c.getInputStream()));
|
||||
return new HTTPResult(url, c.getResponseCode(), c.getRequestProperty("Content-Type"), TextFile.streamToBytes(c.getResponseCode() >= 400 ? c.getErrorStream() : c.getInputStream()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ public class PackageClient {
|
|||
address));
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue