Added usage of new updated shuffle-shared with bugfixes for infinite loops and label management

This commit is contained in:
frikky
2023-03-28 19:34:05 +02:00
parent 8203f4b648
commit f720fcb91e
7 changed files with 101 additions and 3 deletions
+9
View File
@@ -2062,6 +2062,15 @@ func handleWebhookCallback(resp http.ResponseWriter, request *http.Request) {
}
}
// Find user agent header
userAgent := request.Header.Get("User-Agent")
if strings.Contains(strings.ToLower(userAgent), "microsoftpreview") || strings.Contains(strings.ToLower(userAgent), "googlebot") {
log.Printf("[AUDIT] Blocking googlebot and microsoftbot for webhooks. UA: '%s'", userAgent)
resp.WriteHeader(400)
resp.Write([]byte(`{"success": false, "reason": "Google/Microsoft preview bots not allowed. Please change the useragent."}`))
return
}
// ID: webhook_<UID>
if len(hookId) != 44 {
log.Printf("[INFO] Couldn't handle hookId. Too short in webhook: %d", len(hookId))