Skip to content

Commit

Permalink
Fix potential cross-site scripting issue
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 cfcb937 commit bde9cb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/collector/app/handler/http_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package handler

import (
"fmt"
"html"
"io/ioutil"
"mime"
"net/http"
Expand Down Expand Up @@ -76,7 +77,7 @@ func (aH *APIHandler) SaveSpan(w http.ResponseWriter, r *http.Request) {
}

if _, ok := acceptedThriftFormats[contentType]; !ok {
http.Error(w, fmt.Sprintf("Unsupported content type: %v", contentType), http.StatusBadRequest)
http.Error(w, fmt.Sprintf("Unsupported content type: %v", html.EscapeString(contentType)), http.StatusBadRequest)
return
}

Expand Down

0 comments on commit bde9cb8

Please sign in to comment.