fix crash in case of specially-crafted HTTP requests (#2166) (#2169)

This commit is contained in:
Alessandro Ros 2023-08-07 17:16:33 +02:00 committed by GitHub
parent 61d300396d
commit efcc4c4e65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 200 additions and 105 deletions

View file

@ -0,0 +1,15 @@
package httpserv
import (
"net/http"
)
// set the Server header.
type handlerServerHeader struct {
http.Handler
}
func (h *handlerServerHeader) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "mediamtx")
h.Handler.ServeHTTP(w, r)
}