Skip to content

Commit 00cc3cc

Browse files
rdimitrovalexellis
authored andcommitted
Ignore body errors in the template for simplicity
Signed-off-by: Radoslav Dimitrov <[email protected]>
1 parent 8703059 commit 00cc3cc

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

template/golang-middleware-armhf/function/handler.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ func Handle(w http.ResponseWriter, r *http.Request) {
1212
if r.Body != nil {
1313
defer r.Body.Close()
1414

15-
body, err := ioutil.ReadAll(r.Body)
16-
17-
if err != nil {
18-
http.Error(w, err.Error(), http.StatusInternalServerError)
19-
return
20-
}
15+
body, _ := ioutil.ReadAll(r.Body)
2116

2217
input = body
2318
}

template/golang-middleware/function/handler.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ func Handle(w http.ResponseWriter, r *http.Request) {
1212
if r.Body != nil {
1313
defer r.Body.Close()
1414

15-
body, err := ioutil.ReadAll(r.Body)
16-
17-
if err != nil {
18-
http.Error(w, err.Error(), http.StatusInternalServerError)
19-
return
20-
}
15+
body, _ := ioutil.ReadAll(r.Body)
2116

2217
input = body
2318
}

0 commit comments

Comments
 (0)