func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	// TODO: Move webhook handling logic out of hook binary so that we don't have to import all
	// plugins just to validate the webhook.
	eventType, eventGUID, payload, ok, _ := github.ValidateWebhook(w, r, s.tokenGenerator())
	if !ok {
		return
	}
	fmt.Fprint(w, "Event received. Have a nice day.")

	if err := s.handleEvent(eventType, eventGUID, payload); err != nil {
		logrus.WithError(err).Error("Error parsing event.")
	}
}
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	
	
	eventType, eventGUID, payload, ok, _ := github.ValidateWebhook(w, r, s.tokenGenerator())
	if !ok {
		return
	}
	fmt.Fprint(w, "Event received. Have a nice day.")

	if err := s.handleEvent(eventType, eventGUID, payload); err != nil {
		logrus.WithError(err).Error("Error parsing event.")
	}
}
func ( s * Server ) ServeHTTP ( w http . ResponseWriter , r * http . Request ) { // TODO: Move webhook handling logic out of hook binary so that we don't have to import all // plugins just to validate the webhook. eventType , eventGUID , payload , ok , _ := github . ValidateWebhook ( w , r , s . tokenGenerator ( ) ) if ! ok { return } fmt . Fprint ( w , " " ) if err := s . handleEvent ( eventType , eventGUID , payload ) ; err != nil { logrus . WithError ( err ) . Error ( " " ) } }
// ServeHTTP validates an incoming webhook and puts it into the event channel.
ServeHTTP validates an incoming webhook and puts it into the event channel .