mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 02:21:34 +00:00
Merge pull request #974 from nathanleclaire/check_req
Check request type
This commit is contained in:
commit
7237360e44
@ -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 == "" {
|
||||
|
Loading…
Reference in New Issue
Block a user