Add our own botlist for user-agent matching. Closes #51

This commit is contained in:
Gabe Kangas
2020-07-13 19:07:30 -07:00
parent 46b3922e1d
commit ab21706d73
3 changed files with 40 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ import (
"strings"
"text/template"
"github.com/mssola/user_agent"
log "github.com/sirupsen/logrus"
"github.com/gabek/owncast/config"
@@ -38,9 +37,7 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
return
}
ua := user_agent.New(r.UserAgent())
if ua != nil && ua.Bot() && isIndexRequest {
if utils.IsUserAgentABot(r.UserAgent()) && isIndexRequest {
handleScraperMetadataPage(w, r)
return
}