return 405 on non-GET requests to /v1/event/stream (fixes #9526) (#9564)

This commit is contained in:
Dennis Schön 2020-12-08 19:09:20 +01:00 committed by GitHub
parent 62972cc839
commit 038f2cce57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,10 @@ import (
) )
func (s *HTTPServer) EventStream(resp http.ResponseWriter, req *http.Request) (interface{}, error) { func (s *HTTPServer) EventStream(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
if req.Method != http.MethodGet {
return nil, CodedError(http.StatusMethodNotAllowed, ErrInvalidMethod)
}
query := req.URL.Query() query := req.URL.Query()
indexStr := query.Get("index") indexStr := query.Get("index")