summaryrefslogtreecommitdiff
path: root/plugins/http/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/http/plugin.go')
-rw-r--r--plugins/http/plugin.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index 1952679a..ba83344a 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -248,6 +248,12 @@ func (p *Plugin) Stop() error {
// ServeHTTP handles connection using set of middleware and pool PSR-7 server.
func (p *Plugin) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ defer func() {
+ err := r.Body.Close()
+ if err != nil {
+ p.log.Error("body close", "error", err)
+ }
+ }()
if headerContainsUpgrade(r) {
http.Error(w, "server does not support upgrade header", http.StatusInternalServerError)
return