Automatic merge from release/2.2.0 -> release/2.3.0

* commit 'dc04c54dbb43c0e2783e6311859a76640577f2a2':
  避免auzre请求未释放文件描述符
This commit is contained in:
邱剑
2018-12-20 19:56:44 +08:00
+2
View File
@@ -486,6 +486,7 @@ func waitForComplatetion(client *autorest.Client, req *http.Request, resp *http.
if err != nil {
return nil, err
}
defer asyncResp.Body.Close()
if asyncResp.StatusCode == 202 {
if _location := asyncResp.Header.Get("Location"); len(_location) > 0 {
location = _location
@@ -577,6 +578,7 @@ func _jsonRequest(client *autorest.Client, method, domain, baseURL, body string)
log.Errorf("Azure %s request: %s \nbody: %s error: %v", req.Method, req.URL.String(), body, err)
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode == 404 {
data := []byte{}