More debug
This commit is contained in:
parent
eedb9b7e90
commit
b0abddfe42
7
main.go
7
main.go
@ -30,11 +30,16 @@ type SlackConfig struct {
|
||||
|
||||
// PostHandler send notifications from synology to slack
|
||||
func PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||
for name, values := range r.Header {
|
||||
// Loop over all values for the name.
|
||||
for _, value := range values {
|
||||
fmt.Println(name, value)
|
||||
}
|
||||
}
|
||||
api := 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: %s", api)
|
||||
log.Printf(r)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user