Check request type in /diagnose

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2017-01-06 15:45:44 -08:00
parent 473ef04bd9
commit 2887824529

View File

@ -50,6 +50,11 @@ func (h HTTPDiagnosticListener) Listen() {
})
http.HandleFunc("/diagnose", func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
http.Error(w, "Invalid request type. Should be POST with form value 'session' set", http.StatusBadRequest)
return
}
diagnosticsSessionID := r.FormValue(sessionIDField)
if diagnosticsSessionID == "" {