More debug code

This commit is contained in:
Jonathan Ervine 2020-08-28 11:43:46 +08:00
parent 76c92a0da9
commit f9f254e9fc

View File

@ -30,11 +30,10 @@ type SlackConfig struct {
// PostHandler send notifications from synology to slack
func PostHandler(w http.ResponseWriter, r *http.Request) {
var api_key = r.Header.Get("api_key")
log.Printf(r.Header)
if r.Header.Get("api_key") != appConfig.APIKey {
http.Error(w, "invalid api key", http.StatusUnauthorized)
log.Printf("invalid api key")
log.Printf("Received key: ", api_key)
return
}