Skip to content

Commit

Permalink
fix(rollup): content-type check
Browse files Browse the repository at this point in the history
  • Loading branch information
gligneul committed Jan 2, 2024
1 parent d9818cb commit a4a9e8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/rollup/rollup.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package rollup

import (
"net/http"
"strings"
"time"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -189,8 +190,8 @@ func (r *rollupAPI) RegisterException(c echo.Context) error {

// Check whether the content type is application/json.
func checkContentType(c echo.Context) bool {
contentType := c.Request().Header["Content-Type"]
return len(contentType) == 1 && contentType[0] == "application/json"
ctype := c.Request().Header.Get(echo.HeaderContentType)
return strings.HasPrefix(ctype, echo.MIMEApplicationJSON)
}

// Convert model input to API type.
Expand Down

0 comments on commit a4a9e8e

Please sign in to comment.