Skip to content

Commit

Permalink
Fix the other one
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Dec 20, 2020
1 parent bde9cb8 commit 20d8fee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/collector/app/zipkin/http_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package zipkin
import (
"compress/gzip"
"fmt"
"html"
"io"
"io/ioutil"
"mime"
Expand Down Expand Up @@ -100,7 +101,10 @@ func (aH *APIHandler) saveSpans(w http.ResponseWriter, r *http.Request) {
return
}
if err != nil {
http.Error(w, fmt.Sprintf(handler.UnableToReadBodyErrFormat, err), http.StatusBadRequest)
// CodeQL seems to produce false-positive vulnerability warning.
// https://github.com/github/codeql/issues/4853
safeErr := html.EscapeString(err.Error())
http.Error(w, fmt.Sprintf(handler.UnableToReadBodyErrFormat, safeErr), http.StatusBadRequest)
return
}

Expand Down

0 comments on commit 20d8fee

Please sign in to comment.