mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
18 lines
421 B
Go
18 lines
421 B
Go
|
package beacon
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func newBeaconMiddleware(next http.Handler) http.Handler {
|
||
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||
|
contentType := r.Header.Get("Content-Type")
|
||
|
if contentType != "application/json" && contentType != "" {
|
||
|
http.Error(w, "Content-Type header must be application/json", http.StatusUnsupportedMediaType)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
next.ServeHTTP(w, r)
|
||
|
})
|
||
|
}
|