From 76c92a0da9a55489969d532b85b6960296e6b371 Mon Sep 17 00:00:00 2001 From: Jonathan Ervine Date: Fri, 28 Aug 2020 11:39:16 +0800 Subject: [PATCH] Fixed debug code --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 177b4ed..16d0efd 100644 --- a/main.go +++ b/main.go @@ -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 }