mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 17:44:29 +00:00
20 lines
456 B
Go
20 lines
456 B
Go
package beacon
|
|
|
|
import (
|
|
"fmt"
|
|
"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 != "" {
|
|
fmt.Println(contentType)
|
|
http.Error(w, "Content-Type header must be application/json", http.StatusUnsupportedMediaType)
|
|
return
|
|
}
|
|
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|