1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

hotfix: remove user agent check for shields.io

This commit is contained in:
Ferdinand Mütsch 2021-03-09 23:15:35 +01:00
parent f2f6fe1483
commit 2846748b26
2 changed files with 1 additions and 7 deletions

View File

@ -9,7 +9,6 @@ import (
"github.com/muety/wakapi/utils"
"net/http"
"regexp"
"strings"
"time"
)
@ -52,11 +51,6 @@ func (h *BadgeHandler) Get(w http.ResponseWriter, r *http.Request) {
intervalReg := regexp.MustCompile(intervalPattern)
entityFilterReg := regexp.MustCompile(entityFilterPattern)
if userAgent := r.Header.Get("user-agent"); !strings.HasPrefix(userAgent, "Shields.io/") && !h.config.IsDev() {
w.WriteHeader(http.StatusForbidden)
return
}
var filterEntity, filterKey string
if groups := entityFilterReg.FindStringSubmatch(r.URL.Path); len(groups) > 2 {
filterEntity, filterKey = groups[1], groups[2]

View File

@ -1 +1 @@
1.24.6
1.24.7