Skip to content

Commit

Permalink
p2p/simulations: escape mockerType value from request (ethereum#24822)
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Lange <fjl@twurst.com>
  • Loading branch information
2 people authored and sadoci committed Jan 27, 2023
1 parent 66f400b commit d5944c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion p2p/simulations/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"context"
"encoding/json"
"fmt"
"html"
"io"
"io/ioutil"
"net/http"
Expand Down Expand Up @@ -336,7 +337,7 @@ func (s *Server) StartMocker(w http.ResponseWriter, req *http.Request) {
mockerType := req.FormValue("mocker-type")
mockerFn := LookupMocker(mockerType)
if mockerFn == nil {
http.Error(w, fmt.Sprintf("unknown mocker type %q", mockerType), http.StatusBadRequest)
http.Error(w, fmt.Sprintf("unknown mocker type %q", html.EscapeString(mockerType)), http.StatusBadRequest)
return
}
nodeCount, err := strconv.Atoi(req.FormValue("node-count"))
Expand Down

0 comments on commit d5944c4

Please sign in to comment.