Skip to content
Snippets Groups Projects
Unverified Commit b42779a2 authored by Will McCutchen's avatar Will McCutchen Committed by GitHub
Browse files

Close XSS issue in /base64 endpoint (fixes #67) (#68)

parent e2bb3ece
No related branches found
No related tags found
No related merge requests found
......@@ -982,7 +982,7 @@ func (h *HTTPBin) Base64(w http.ResponseWriter, r *http.Request) {
http.Error(w, fmt.Sprintf("%s failed: %s", b.operation, base64Error), http.StatusBadRequest)
return
}
writeResponse(w, http.StatusOK, "text/html", result)
writeResponse(w, http.StatusOK, "text/plain", result)
}
// JSON - returns a sample json
......
......@@ -2425,6 +2425,7 @@ func TestBase64(t *testing.T) {
w := httptest.NewRecorder()
handler.ServeHTTP(w, r)
assertStatusCode(t, w, http.StatusOK)
assertContentType(t, w, "text/plain")
assertBodyEquals(t, w, test.want)
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment