mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-24 19:28:09 +00:00
Check request type in /diagnose
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
parent
473ef04bd9
commit
2887824529
@ -50,6 +50,11 @@ func (h HTTPDiagnosticListener) Listen() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
http.HandleFunc("/diagnose", func(w http.ResponseWriter, r *http.Request) {
|
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)
|
diagnosticsSessionID := r.FormValue(sessionIDField)
|
||||||
|
|
||||||
if diagnosticsSessionID == "" {
|
if diagnosticsSessionID == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user