Gradually remove Macaron web framework (#36325)

* add macaron code to the code base

* remove unused secure cookies support from macaron

* clean up modules

* remove com dependency

* fix silly typos

* little cleanup, remove recovery middleware

* remove logger middleware

* remove static handler and remove unused context methods

* bring inject into macaron codebase

* remove unused applicator

* add back macaron license

* more cleanups in macaron code

* remove unused injector Set method

* remove unused context methods: param to int conversion, body helper type, cookie helpers

* remove action from context

* remove complex environment handling, we only use Env variable

* restore ReplaceAllParams to fix the tests
This commit is contained in:
Serge Zaitsev
2021-07-08 14:19:40 +02:00
committed by GitHub
parent 4c0acf335b
commit 9b2d7d6d69
13 changed files with 2535 additions and 2 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package pushhttp
import (
"context"
"errors"
"io"
"net/http"
"github.com/grafana/grafana/pkg/infra/log"
@@ -58,7 +59,7 @@ func (g *Gateway) Handle(ctx *models.ReqContext) {
urlValues := ctx.Req.URL.Query()
frameFormat := pushurl.FrameFormatFromValues(urlValues)
body, err := ctx.Req.Body().Bytes()
body, err := io.ReadAll(ctx.Req.Request.Body)
if err != nil {
logger.Error("Error reading body", "error", err)
ctx.Resp.WriteHeader(http.StatusInternalServerError)