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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user