Skip to content

Commit

Permalink
Merge pull request cosmos#404 from secret2830/secret/remove-wasm-limi…
Browse files Browse the repository at this point in the history
…t-for-rest

Remove redundant wasm bytes limit in rest
  • Loading branch information
alpe authored Feb 5, 2021
2 parents 4141cc3 + d46871e commit a278049
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions x/wasm/client/rest/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ func registerTxRoutes(cliCtx client.Context, r *mux.Router) {
r.HandleFunc("/wasm/contract/{contractAddr}", executeContractHandlerFn(cliCtx)).Methods("POST")
}

// limit max bytes read to prevent gzip bombs
const maxSize = 400 * 1024

type storeCodeReq struct {
BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
WasmBytes []byte `json:"wasm_bytes"`
Expand Down Expand Up @@ -55,10 +52,6 @@ func storeCodeHandlerFn(cliCtx client.Context) http.HandlerFunc {

var err error
wasm := req.WasmBytes
if len(wasm) > maxSize {
rest.WriteErrorResponse(w, http.StatusBadRequest, "Binary size exceeds maximum limit")
return
}

// gzip the wasm file
if wasmUtils.IsWasm(wasm) {
Expand Down

0 comments on commit a278049

Please sign in to comment.