Fixed debug code

This commit is contained in:
Jonathan Ervine 2020-08-28 11:39:16 +08:00
parent 6ca699ecb6
commit 76c92a0da9

View File

@ -30,10 +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")
if r.Header.Get("api_key") != appConfig.APIKey {
http.Error(w, "invalid api key", http.StatusUnauthorized)
log.Printf("invalid api key")
api_key = r.Header.Get("api_key")
log.Printf("Received key: ", api_key)
return
}