Fix http response body not closed correctly, return immediately on error (#210)
* Fix controller timer handler not return when error occurred * Fix controller not close http response correctly This PR aims to fix controller not close response correctly. Also, I’ve check all over the project there is no more resource leak issues exist after this patch. * Fix controller not return immediately when error occurred * Sort import
This commit is contained in:
committed by
Soam Vasani
parent
a8e7ec534b
commit
d9b98830cf
@@ -47,6 +47,7 @@ func (api *API) HTTPTriggerApiCreate(w http.ResponseWriter, r *http.Request) {
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
api.respondWithError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
var t fission.HTTPTrigger
|
||||
@@ -116,6 +117,7 @@ func (api *API) HTTPTriggerApiUpdate(w http.ResponseWriter, r *http.Request) {
|
||||
body, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
api.respondWithError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
var t fission.HTTPTrigger
|
||||
|
||||
Reference in New Issue
Block a user