mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
don't use ReadAll when decoding JSON
An empty stream isn't valid JSON, so we shouldn't silently ignore it.
This commit is contained in:
+1
-1
@@ -31,7 +31,7 @@ func CreateComponent(ua HttpClient, endpoint string, cp ComponentProvider) (*jir
|
||||
|
||||
if resp.StatusCode == 201 {
|
||||
results := &jiradata.Component{}
|
||||
return results, readJSON(resp.Body, results)
|
||||
return results, json.NewDecoder(resp.Body).Decode(results)
|
||||
}
|
||||
return nil, responseError(resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user