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:
parent
f2f6fe1483
commit
2846748b26
@ -9,7 +9,6 @@ import (
|
|||||||
"github.com/muety/wakapi/utils"
|
"github.com/muety/wakapi/utils"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -52,11 +51,6 @@ func (h *BadgeHandler) Get(w http.ResponseWriter, r *http.Request) {
|
|||||||
intervalReg := regexp.MustCompile(intervalPattern)
|
intervalReg := regexp.MustCompile(intervalPattern)
|
||||||
entityFilterReg := regexp.MustCompile(entityFilterPattern)
|
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
|
var filterEntity, filterKey string
|
||||||
if groups := entityFilterReg.FindStringSubmatch(r.URL.Path); len(groups) > 2 {
|
if groups := entityFilterReg.FindStringSubmatch(r.URL.Path); len(groups) > 2 {
|
||||||
filterEntity, filterKey = groups[1], groups[2]
|
filterEntity, filterKey = groups[1], groups[2]
|
||||||
|
@ -1 +1 @@
|
|||||||
1.24.6
|
1.24.7
|
||||||
|
Loading…
Reference in New Issue
Block a user