Issue #261: handle 204 no content correctly

This commit is contained in:
Kohsuke Kawaguchi
2016-06-03 20:27:29 -07:00
parent 16a0f8ece0
commit 0415326d09
3 changed files with 16 additions and 4 deletions

View File

@@ -512,6 +512,10 @@ class Requester {
if (responseCode == 304) {
return null; // special case handling for 304 unmodified, as the content will be ""
}
if (responseCode == 204 && type.isArray()) {
// no content
return type.cast(Array.newInstance(type.getComponentType(),0));
}
r = new InputStreamReader(wrapStream(uc.getInputStream()), "UTF-8");
String data = IOUtils.toString(r);