Merge pull request #729 from hapifhir/gg-202202-http-issues
fix up http issues?
This commit is contained in:
commit
74aaa2f03d
|
@ -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